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

A sqlite function context. More...

#include <sqlitefunctioncontext.h>

Public Member Functions

 SqliteFunctionContext (sqlite3_context *ctx, int argc, sqlite3_value **argv) noexcept
 Constructs an SqliteFunctionContext.
 
 SqliteFunctionContext (const SqliteFunctionContext &)=delete
 
 SqliteFunctionContext (SqliteFunctionContext &&other) noexcept
 Constructs a SqliteFunctionContext via move.
 
void * getUserData () const noexcept
 Gets the pointer to the user data for the context.
 
const std::vector< SqliteValue > & getArgs () const noexcept
 Gets the list of SqliteValue arguments passed to the function.
 
void result () noexcept
 Returns a NULL value from the sql function.
 
template<SupportedSqliteValue T>
void result (const T &value) noexcept
 Returns a value from the sqlite function.
 
void error (const std::string &err) noexcept
 Returns an error from the sql function.
 
void error (int err) noexcept
 Returns an error from the sql function.
 
SqliteFunctionContextoperator= (const SqliteFunctionContext &)=delete
 
SqliteFunctionContextoperator= (SqliteFunctionContext &&other) noexcept
 Assigns a SqliteFunctionContext via move.
 

Detailed Description

A sqlite function context.

Constructor & Destructor Documentation

◆ SqliteFunctionContext() [1/3]

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

Constructs an SqliteFunctionContext.

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

◆ SqliteFunctionContext() [2/3]

Nickvision::Database::SqliteFunctionContext::SqliteFunctionContext ( const SqliteFunctionContext & )
delete

◆ SqliteFunctionContext() [3/3]

Nickvision::Database::SqliteFunctionContext::SqliteFunctionContext ( SqliteFunctionContext && other)
noexcept

Constructs a SqliteFunctionContext via move.

Parameters
otherThe other SqliteFunctionContext to move

Member Function Documentation

◆ error() [1/2]

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

Returns an error from the sql function.

Parameters
errThe error message

◆ error() [2/2]

void Nickvision::Database::SqliteFunctionContext::error ( int err)
noexcept

Returns an error from the sql function.

Parameters
errThe error code

◆ getArgs()

const std::vector< SqliteValue > & Nickvision::Database::SqliteFunctionContext::getArgs ( ) const
noexcept

Gets the list of SqliteValue arguments passed to the function.

Returns
The list of arguments

◆ getUserData()

void * Nickvision::Database::SqliteFunctionContext::getUserData ( ) const
noexcept

Gets the pointer to the user data for the context.

Returns
The user data pointer

◆ operator=() [1/2]

SqliteFunctionContext & Nickvision::Database::SqliteFunctionContext::operator= ( const SqliteFunctionContext & )
delete

◆ operator=() [2/2]

SqliteFunctionContext & Nickvision::Database::SqliteFunctionContext::operator= ( SqliteFunctionContext && other)
noexcept

Assigns a SqliteFunctionContext via move.

Parameters
otherThe other SqliteFunctionContext to move
Returns
Reference to this SqliteFunctionContext

◆ result() [1/2]

void Nickvision::Database::SqliteFunctionContext::result ( )
noexcept

Returns a NULL value from the sql function.

◆ result() [2/2]

template<SupportedSqliteValue T>
void Nickvision::Database::SqliteFunctionContext::result ( const T & value)
inlinenoexcept

Returns a value from the sqlite function.

Template Parameters
TThe type of the value to return
Parameters
valueThe value to return

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