Sq3ValueC - get type from value … More...
Functions | |
static MK_BINN | Sq3ValueBlobHide (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MK_DBL | Sq3ValueDouble (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MK_I32 | Sq3ValueInt (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MK_I64 | Sq3ValueInt64 (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MK_PTR | Sq3ValuePointer (SQ3_VALN sq3val, MK_STRN arg1) |
Obtaining SQL Values … | |
static MK_STRN | Sq3ValueText (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MkBinaryR | Sq3ValueBinaryR (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MK_BUF | Sq3ValueBlob_RT (MK_RT mkrt, SQ3_VALN sq3val) |
Obtaining SQL Values … | |
static MkStringR | Sq3ValueStringR (SQ3_VALN sq3val) |
Obtaining SQL Values … | |
MK_BUF | Sq3ValueBUF_RT (MK_RT mkrt, SQ3_VALN const val) |
Obtaining a MkBufferC value… | |
Sq3ValueC - Sq3ValueC_Types_C_API - function | |
MK_BUF | Sq3ValueBlobP (MK_RT mkrt, SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueBlob … | |
MkBinaryR | Sq3ValueBinaryRP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueBinaryR … | |
MK_BINN | Sq3ValueBlobHideP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueBlobHide … | |
MK_DBL | Sq3ValueDoubleP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueDouble … | |
MK_I32 | Sq3ValueIntP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueInt … | |
MK_I64 | Sq3ValueInt64P (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueInt64 … | |
MK_PTR | Sq3ValuePointerP (SQ3_VALN sq3val, MK_STRN arg1) |
Non-inline replacement for Sq3ValuePointer … | |
MkStringR | Sq3ValueStringRP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueStringR … | |
MK_STRN | Sq3ValueTextP (SQ3_VALN sq3val) |
Non-inline replacement for Sq3ValueText … | |
Sq3ValueC - Sq3ValueC_Types_C_API - overload | |
#define | Sq3ValueBUF_NULL(...) |
#define | Sq3ValueBUF(...) |
#define | Sq3ValueBlob_NULL(...) |
#define | Sq3ValueBlob(...) |
Sq3ValueC - get type from value …
#define Sq3ValueBlob | ( | ... | ) |
Definition at line 728 of file sqlite3_overload_sq3.h.
#define Sq3ValueBlob_NULL | ( | ... | ) |
Definition at line 727 of file sqlite3_overload_sq3.h.
#define Sq3ValueBUF | ( | ... | ) |
Definition at line 726 of file sqlite3_overload_sq3.h.
#define Sq3ValueBUF_NULL | ( | ... | ) |
Definition at line 725 of file sqlite3_overload_sq3.h.
Obtaining SQL Values …
read more at 'Sq3ValueBlobHide'
Definition at line 181 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueBinaryR …
Obtaining SQL Values …
read more at 'Sq3ValueBlobHide'
"MK_NULL"
for a non-error result.Definition at line 194 of file Sq3ValueC_sq3.h.
Obtaining SQL Values …
Summary:
sqlite3_value_blob → BLOB value sqlite3_value_double → REAL value sqlite3_value_int → 32-bit INTEGER value sqlite3_value_int64 → 64-bit INTEGER value sqlite3_value_pointer → Pointer value sqlite3_value_text → UTF-8 TEXT value sqlite3_value_text16 → UTF-16 TEXT value in the native byteorder sqlite3_value_text16be → UTF-16be TEXT value sqlite3_value_text16le → UTF-16le TEXT value sqlite3_value_bytes → Size of a BLOB or a UTF-8 TEXT in bytes sqlite3_value_bytes16 → Size of UTF-16 TEXT in bytes sqlite3_value_type → Default datatype of the value sqlite3_value_numeric_type → Best numeric datatype of the value sqlite3_value_nochange → True if the column is unchanged in an UPDATE against a virtual table. sqlite3_value_frombind → True if value originated from a bound parameter
Details:
These routines extract type, size, and content information from protected Sq3ValueC objects. Protected Sq3ValueC objects are used to pass parameter information into the functions that implement application-defined SQL functions and virtual tables.
These routines work only with protected Sq3ValueC objects. Any attempt to use these routines on an unprotected Sq3ValueC is not threadsafe.
These routines work just like the corresponding column access functions except that these routines take a single protected Sq3ValueC object pointer instead of a Sq3StmtC* pointer and an integer column number.
The sqlite3_value_text16() interface extracts a UTF-16 string in the native byte-order of the host machine. The sqlite3_value_text16be() and sqlite3_value_text16le() interfaces extract UTF-16 strings as big-endian and little-endian respectively.
If Sq3ValueC object V was initialized using Sq3StmtBindPointer (S,I,P,X,D) or sqlite3_result_pointer (C,P,X,D) and if X and Y are strings that compare equal according to strcmp(X,Y), then Sq3ValuePointer(V,Y) will return the pointer P. Otherwise, Sq3ValuePointer(V,Y) returns a NULL. The Sq3StmtBindPointer() routine is part of the pointer passing interface added for SQLite 3.20.0.
The Sq3ValueType(V) interface returns the datatype code for the initial datatype of the Sq3ValueC object V. The returned value is one of SQ3_TYPE_INTEGER, SQ3_TYPE_FLOAT, SQ3_TYPE_TEXT, SQ3_TYPE_BLOB, or SQ3_TYPE_NULL. Other interfaces might change the datatype for an Sq3ValueC object. For example, if the datatype is initially SQ3_TYPE_INTEGER and Sq3ValueText(V) is called to extract a text value for that integer, then subsequent calls to Sq3ValueType(V) might return SQ3_TYPE_TEXT. Whether or not a persistent internal datatype conversion occurs is undefined and may change from one release of SQLite to the next.
The Sq3ValueNumericType() interface attempts to apply numeric affinity to the value. This means that an attempt is made to convert the value to an integer or floating point. If such a conversion is possible without loss of information (in other words, if the value is a string that looks like a number) then the conversion is performed. Otherwise no conversion occurs. The datatype after conversion is returned.
Within the xUpdate method of a virtual table, the Sq3ValueNoChange(X) interface returns true if and only if the column corresponding to X is unchanged by the UPDATE operation that the xUpdate method call was invoked to implement and if and the prior xColumn method call that was invoked to extracted the value for that column returned without setting a result (probably because it queried sqlite3_vtab_nochange () and found that the column was unchanging). Within an xUpdate method, any value for which Sq3ValueNoChange(X) is true will in all other respects appear to be a NULL value. If Sq3ValueNoChange(X) is invoked anywhere other than within an xUpdate method call for an UPDATE statement, then the return value is arbitrary and meaningless.
The Sq3ValueFromBind(X) interface returns non-zero if the value X originated from one of the sqlite3_bind() interfaces. If X comes from an SQL literal value, or a table column, or an expression, then Sq3ValueFromBind(X) returns zero.
Please pay particular attention to the fact that the pointer returned from Sq3ValueBlob (), Sq3ValueText (), or sqlite3_value_text16 () can be invalidated by a subsequent call to Sq3ValueBytes (), sqlite3_value_bytes16 (), Sq3ValueText (), or sqlite3_value_text16 ().
These routines must be called from the same thread as the SQL function that supplied the Sq3ValueC* parameters.
As long as the input parameter is correct, these routines can only fail if an out-of-memory error occurs during a format conversion. Only the following subset of interfaces are subject to out-of-memory errors:
If an out-of-memory error occurs, then the return value from these routines is the same as if the column had contained an SQL NULL value. Valid SQL NULL returns can be distinguished from out-of-memory errors by invoking the Sq3LiteErrCode () immediately after the suspect return value is obtained and before any other SQLite interface is called on the same database connection.
Reference code from sqlite3:
Definition at line 103 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueBlobHide …
Non-inline replacement for Sq3ValueBlob …
Obtaining a MkBufferC value…
read more at Sq3ValueBlobHide
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | val | Programming-Language-Micro-Kernel (PLMK) instance from sqlite3_value |
Obtaining SQL Values …
Definition at line 109 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueDouble …
Obtaining SQL Values …
Definition at line 115 of file Sq3ValueC_sq3.h.
Obtaining SQL Values …
Definition at line 121 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueInt64 …
Non-inline replacement for Sq3ValueInt …
Obtaining SQL Values …
Definition at line 127 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValuePointer …
Obtaining SQL Values …
read more at 'Sq3ValueBlobHide'
"MK_NULL"
for a non-error result.Definition at line 208 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueStringR …
Obtaining SQL Values …
Definition at line 133 of file Sq3ValueC_sq3.h.
Non-inline replacement for Sq3ValueText …