libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
sqlcontext.h
Go to the documentation of this file.
1
23#ifndef SQLCONTEXT_H
24#define SQLCONTEXT_H
25
26#ifndef SQLITE_HAS_CODEC
27#define SQLITE_HAS_CODEC
28#endif
29
30#include <string>
31#include <vector>
32#ifdef _WIN32
33#include <sqlcipher/sqlite3.h>
34#else
35#include "sqlite3.h"
36#endif
37#include "sqlvalue.h"
38
40{
45 {
46 public:
53 SqlContext(sqlite3_context* ctx, int argc, sqlite3_value** argv);
58 void* getUserData() const;
63 const std::vector<SqlValue>& getArgs() const;
67 void result();
72 void result(int value);
77 void result(sqlite3_int64 value);
82 void result(double value);
87 void result(bool value);
92 void result(const std::string& value);
98 void result(void* value, int n);
103 void error(const std::string& err);
108 void error(int err);
109
110 private:
111 sqlite3_context* m_context;
112 std::vector<SqlValue> m_values;
113 };
114}
115
116#endif //SQLCONTEXT_H
A sqlite function context.
Definition sqlcontext.h:45
void error(int err)
Returns an error from the sql function.
void result(int value)
Returns an int value from the sql function.
void result(double value)
Returns a double value from the sql function.
void error(const std::string &err)
Returns an error 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 * 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(bool value)
Returns a bool value from the sql function.
void result(sqlite3_int64 value)
Returns an int64 value from the sql function.
SqlContext(sqlite3_context *ctx, int argc, sqlite3_value **argv)
Constructs an SqlContext.
void result()
Returns a NULL value from the sql function.
Definition sqlcontext.h:40