libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::Database::SqlContext Class Reference

A sqlite function context. More...

#include <sqlcontext.h>

Public Member Functions

 SqlContext (sqlite3_context *ctx, int argc, sqlite3_value **argv)
 Constructs an SqlContext.
 
void * getUserData () const
 Gets the pointer to the user data for the context.
 
const std::vector< SqlValue > & getArgs () const
 Gets the list of SqlValue arguments passed to the function.
 
void result ()
 Returns a NULL value from the sql function.
 
void result (int value)
 Returns an int value from the sql function.
 
void result (sqlite3_int64 value)
 Returns an int64 value from the sql function.
 
void result (double value)
 Returns a double value from the sql function.
 
void result (bool value)
 Returns a bool value from the sql function.
 
void result (const std::string &value)
 Returns a string value from the sql function.
 
void result (void *value, int n)
 Returns a blob value from the sql function.
 
void error (const std::string &err)
 Returns an error from the sql function.
 
void error (int err)
 Returns an error from the sql function.
 

Detailed Description

A sqlite function context.

Constructor & Destructor Documentation

◆ SqlContext()

Nickvision::Database::SqlContext::SqlContext ( sqlite3_context * ctx,
int argc,
sqlite3_value ** argv )

Constructs an SqlContext.

Parameters
ctxsqlite3_context*
argcThe number of arguments passed to the context
argvThe sqlite3_value*'s passed to the context

Member Function Documentation

◆ error() [1/2]

void Nickvision::Database::SqlContext::error ( const std::string & err)

Returns an error from the sql function.

Parameters
errThe error message

◆ error() [2/2]

void Nickvision::Database::SqlContext::error ( int err)

Returns an error from the sql function.

Parameters
errThe error code

◆ getArgs()

const std::vector< SqlValue > & Nickvision::Database::SqlContext::getArgs ( ) const

Gets the list of SqlValue arguments passed to the function.

Returns
The list of arguments

◆ getUserData()

void * Nickvision::Database::SqlContext::getUserData ( ) const

Gets the pointer to the user data for the context.

Returns
The user data pointer

◆ result() [1/7]

void Nickvision::Database::SqlContext::result ( )

Returns a NULL value from the sql function.

◆ result() [2/7]

void Nickvision::Database::SqlContext::result ( bool value)

Returns a bool value from the sql function.

Parameters
valueThe bool value to return

◆ result() [3/7]

void Nickvision::Database::SqlContext::result ( const std::string & value)

Returns a string value from the sql function.

Parameters
valueThe string value to return

◆ result() [4/7]

void Nickvision::Database::SqlContext::result ( double value)

Returns a double value from the sql function.

Parameters
valueThe double value to return

◆ result() [5/7]

void Nickvision::Database::SqlContext::result ( int value)

Returns an int value from the sql function.

Parameters
valueThe int value to return

◆ result() [6/7]

void Nickvision::Database::SqlContext::result ( sqlite3_int64 value)

Returns an int64 value from the sql function.

Parameters
valueThe int64 value to return

◆ result() [7/7]

void Nickvision::Database::SqlContext::result ( void * value,
int n )

Returns a blob value from the sql function.

Parameters
valueThe blob value to return
nThe size of the blob value

The documentation for this class was generated from the following file: