9#ifndef HEADER_SQLITEPP_CONTEXT_IFACE_INCLUDED
10#define HEADER_SQLITEPP_CONTEXT_IFACE_INCLUDED
13#include "value_iface.hpp"
69 #if __cpp_char8_t >= 201811
84 void error(
int error_code)
noexcept
148 if (
auto data =
value.data())
153 #if __cpp_char8_t >= 201811
158 if (
auto data =
value.data())
178 if (
auto data =
value.data())
183 #if __cpp_char8_t >= 201811
188 if (
auto data =
value.data())
211 if (
auto data =
value.data())
222 #if __cpp_char8_t >= 201811
227 if (
auto data =
value.data())
252 if (
auto data =
value.data())
272 if (
auto data =
value.data())
295 if (
auto data =
value.data())
330 template<
class T,
class D>
332 void)
result(T * ptr,
const char * type, D destroy)
noexcept
347 { this->
result(ptr.release(),
typeid(T).name(), [](T * p)
noexcept { delete p;}); }
357#if SQLITE_VERSION_NUMBER >= SQLITEPP_SQLITE_VERSION(3, 9, 0)
388 void set_auxdata(
int arg, T * data,
void (*destroy)(T*)
noexcept)
noexcept
404#if SQLITE_VERSION_NUMBER >= SQLITEPP_SQLITE_VERSION(3, 22, 0)
sqlite3_aggregate_context
SQL Function Context Object.
Definition context_iface.hpp:38
void result(int value) noexcept
Return an int from the implemented SQL function.
Definition context_iface.hpp:116
void result_subtype(unsigned value) noexcept
Sets the subtype of the result of the implemented SQL function.
Definition context_iface.hpp:365
void result(double value) noexcept
Return a double from implemented SQL function.
Definition context_iface.hpp:132
~context() noexcept=delete
Contexts are never destroyed by user code.
class database & database() const noexcept
Retrieve database connection for the context.
Definition context_iface.hpp:56
void result(int64_t value) noexcept
Return an int64_t from implemented SQL function.
Definition context_iface.hpp:124
void error(int error_code) noexcept
Changes the error code returned by function evaluation.
Definition context_iface.hpp:84
void result(std::unique_ptr< T > ptr) noexcept
Return a custom pointer from the implemented SQL function.
Definition context_iface.hpp:346
void result_reference(const std::string_view &value) noexcept
Return a string by reference from the implemented SQL function.
Definition context_iface.hpp:175
T * get_auxdata(int arg) const noexcept
Get auxiliary data associated with argument values.
Definition context_iface.hpp:377
void result(const blob_view &value) noexcept
Return a blob by value from the implemented SQL function.
Definition context_iface.hpp:249
void error_toobig() noexcept
Causes the implemented SQL function to throw an SQL exception indicating that a string or BLOB is too...
Definition context_iface.hpp:100
void result(const zero_blob &value) noexcept
Return a blob of zeroes from the implemented SQL function.
Definition context_iface.hpp:316
void result(const value &val) noexcept
Return a copy of the passed value from the implemented SQL function.
Definition context_iface.hpp:354
void result(const std::u8string_view &value) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition context_iface.hpp:155
T * user_data() noexcept
Return the function's user data.
Definition context_iface.hpp:401
bool vtab_nochange() const noexcept
Return if a value being fetched as part of an UPDATE operation during which the column value will not...
Definition context_iface.hpp:410
void result(std::nullptr_t) noexcept
Return NULL from the implemented SQL function.
Definition context_iface.hpp:108
void error_nomem() noexcept
Causes the implemented SQL function to throw an SQL exception indicating that a memory allocation fai...
Definition context_iface.hpp:92
void result(T *ptr, const char *type, D destroy) noexcept
Definition context_iface.hpp:332
void error(const std::string_view &value) noexcept
Cause the implemented SQL function to throw an SQL exception.
Definition context_iface.hpp:67
void result_reference(const std::u8string_view &value) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition context_iface.hpp:185
void result_reference(const std::u8string_view &value, void(*unref)(const char8_t *) noexcept) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition context_iface.hpp:224
void result_reference(const blob_view &value, void(*unref)(const std::byte *) noexcept) noexcept
Return a blob by reference from the implemented SQL function.
Definition context_iface.hpp:292
void * aggregate_context(int size) noexcept
Allocate memory for aggregate function context.
Definition context_iface.hpp:48
void result_reference(const blob_view &value) noexcept
Return a blob by reference from the implemented SQL function.
Definition context_iface.hpp:269
void set_auxdata(int arg, T *data, void(*destroy)(T *) noexcept) noexcept
Associate auxiliary data with argument values.
Definition context_iface.hpp:388
void result(const std::string_view &value) noexcept
Return a string by value from the implemented SQL function.
Definition context_iface.hpp:145
void error(const std::u8string_view &value) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition context_iface.hpp:71
void result_reference(const std::string_view &value, void(*unref)(const char *) noexcept) noexcept
Return a string by reference from the implemented SQL function.
Definition context_iface.hpp:208
Database Connection.
Definition database_iface.hpp:109
sqlite3_context * c_ptr() const noexcept
Definition handle.hpp:45
Dynamically Typed Value Object.
Definition value_iface.hpp:36
An efficient blob of zeroes of a given size.
Definition span.hpp:257
sqlite3_context_db_handle
span< const std::byte > blob_view
A blob_view is a span of bytes.
Definition span.hpp:239
ThinSQLite++ namespace.
Definition backup_iface.hpp:17