theSq3Lite 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard - theLib - theATL
c - tcl - atl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
Sq3ValueC_Types_C_API

Sq3ValueC - get type from valueMore...

+ Collaboration diagram for Sq3ValueC_Types_C_API:

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(...)
 

Detailed Description

Sq3ValueC - get type from value

Macro Definition Documentation

◆ Sq3ValueBlob

#define Sq3ValueBlob ( ...)
Value:
#define MK_RT_CALL
static MK_BUF Sq3ValueBlob_RT(MK_RT mkrt, SQ3_VALN sq3val)
Obtaining SQL Values …

Definition at line 728 of file sqlite3_overload_sq3.h.

◆ Sq3ValueBlob_NULL

#define Sq3ValueBlob_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 727 of file sqlite3_overload_sq3.h.

◆ Sq3ValueBUF

#define Sq3ValueBUF ( ...)
Value:
MK_BUF Sq3ValueBUF_RT(MK_RT mkrt, SQ3_VALN const val)
Obtaining a MkBufferC value…

Definition at line 726 of file sqlite3_overload_sq3.h.

◆ Sq3ValueBUF_NULL

#define Sq3ValueBUF_NULL ( ...)
Value:

Definition at line 725 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3ValueBinaryR()

static MkBinaryR Sq3ValueBinaryR ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlobHide'

Definition at line 181 of file Sq3ValueC_sq3.h.

181 {
182 SQ3_INSTANCE_HDL(sq3val);
183
184 MK_BINN bin = Sq3ValueBlobHide(sq3val);
185 MK_I32 len = Sq3ValueBytes(sq3val);
186 return MkBinaryCreate(len,bin);
187}
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
MK_BINB const * MK_BINN
signed int MK_I32
#define SQ3_INSTANCE_HDL(x)
static enum Sq3TextE Sq3ValueBytes(SQ3_VALN sq3val)
Obtaining SQL Values …
static MK_BINN Sq3ValueBlobHide(SQ3_VALN sq3val)
Obtaining SQL Values …
+ Here is the caller graph for this function:

◆ Sq3ValueBinaryRP()

MkBinaryR Sq3ValueBinaryRP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueBinaryR

◆ Sq3ValueBlob_RT()

static MK_BUF Sq3ValueBlob_RT ( MK_RT mkrt,
SQ3_VALN sq3val )
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlobHide'

Attention
(do not free) The memory of the out/return value belongs to the called tclsq3lite function and therefore never becomes "MK_NULL" for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.

Definition at line 194 of file Sq3ValueC_sq3.h.

197 {
198 SQ3_INSTANCE_RT_X(sq3val);
199 MkBufferCreateTLS_T(MkBuffer64C,buf,0);
200 return MkBufferSetBinaryR(buf,Sq3ValueBinaryR(sq3val));
201}
#define MkBufferSetBinaryR(...)
#define MkBufferCreateTLS_T(cls, name, size)
#define SQ3_INSTANCE_RT_X(x)
static MkBinaryR Sq3ValueBinaryR(SQ3_VALN sq3val)
Obtaining SQL Values …

◆ Sq3ValueBlobHide()

static MK_BINN Sq3ValueBlobHide ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

Summary:

sqlite3_value_blobBLOB value
sqlite3_value_doubleREAL value
sqlite3_value_int32-bit INTEGER value
sqlite3_value_int6464-bit INTEGER value
sqlite3_value_pointerPointer value
sqlite3_value_textUTF-8 TEXT value
sqlite3_value_text16UTF-16 TEXT value in the native byteorder
sqlite3_value_text16beUTF-16be TEXT value
sqlite3_value_text16leUTF-16le TEXT value
   
sqlite3_value_bytesSize of a BLOB or a UTF-8 TEXT in bytes
sqlite3_value_bytes16   →  Size of UTF-16 TEXT in bytes
sqlite3_value_typeDefault 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:

SQLITE_API const void * sqlite3_value_text16le(sqlite3_value *)
sqlite_int64 sqlite3_int64
#define SQLITE_API
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *)
SQLITE_API const void * sqlite3_value_text16(sqlite3_value *)
SQLITE_API double sqlite3_value_double(sqlite3_value *)
SQLITE_API int sqlite3_value_int(sqlite3_value *)
SQLITE_API int sqlite3_value_bytes16(sqlite3_value *)
SQLITE_API void * sqlite3_value_pointer(sqlite3_value *, const char *)
SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value *)
struct sqlite3_value sqlite3_value
SQLITE_API int sqlite3_value_type(sqlite3_value *)
SQLITE_API const void * sqlite3_value_text16be(sqlite3_value *)
SQLITE_API int sqlite3_value_nochange(sqlite3_value *)
SQLITE_API int sqlite3_value_frombind(sqlite3_value *)
SQLITE_API int sqlite3_value_bytes(sqlite3_value *)
SQLITE_API const unsigned char * sqlite3_value_text(sqlite3_value *)
SQLITE_API const void * sqlite3_value_blob(sqlite3_value *)

Definition at line 103 of file Sq3ValueC_sq3.h.

103 {
104 SQ3_INSTANCE_HDL(sq3val);
105 return (MK_BINN)sqlite3_value_blob(sq3val->nat);
106 }
sqlite3_value * nat
internal - link between Sq3ValueS and native library
+ Here is the caller graph for this function:

◆ Sq3ValueBlobHideP()

MK_BINN Sq3ValueBlobHideP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueBlobHide

◆ Sq3ValueBlobP()

MK_BUF Sq3ValueBlobP ( MK_RT mkrt,
SQ3_VALN sq3val )

Non-inline replacement for Sq3ValueBlob

◆ Sq3ValueBUF_RT()

MK_BUF Sq3ValueBUF_RT ( MK_RT mkrt,
SQ3_VALN const val )

Obtaining a MkBufferC value…

read more at Sq3ValueBlobHide

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valProgramming-Language-Micro-Kernel (PLMK) instance from sqlite3_value

◆ Sq3ValueDouble()

static MK_DBL Sq3ValueDouble ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlob'

Definition at line 109 of file Sq3ValueC_sq3.h.

109 {
110 SQ3_INSTANCE_HDL(sq3val);
111 return sqlite3_value_double(sq3val->nat);
112 }
+ Here is the caller graph for this function:

◆ Sq3ValueDoubleP()

MK_DBL Sq3ValueDoubleP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueDouble

◆ Sq3ValueInt()

static MK_I32 Sq3ValueInt ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlob'

Definition at line 115 of file Sq3ValueC_sq3.h.

115 {
116 SQ3_INSTANCE_HDL(sq3val);
117 return sqlite3_value_int(sq3val->nat);
118 }
+ Here is the caller graph for this function:

◆ Sq3ValueInt64()

static MK_I64 Sq3ValueInt64 ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlob'

Definition at line 121 of file Sq3ValueC_sq3.h.

121 {
122 SQ3_INSTANCE_HDL(sq3val);
123 return sqlite3_value_int64(sq3val->nat);
124 }
+ Here is the caller graph for this function:

◆ Sq3ValueInt64P()

MK_I64 Sq3ValueInt64P ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueInt64

◆ Sq3ValueIntP()

MK_I32 Sq3ValueIntP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueInt

◆ Sq3ValuePointer()

static MK_PTR Sq3ValuePointer ( SQ3_VALN sq3val,
MK_STRN arg1 )
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlob'

Definition at line 127 of file Sq3ValueC_sq3.h.

127 {
128 SQ3_INSTANCE_HDL(sq3val);
129 return (MK_PTR)sqlite3_value_pointer(sq3val->nat, arg1);
130 }
MK_PTRB * MK_PTR

◆ Sq3ValuePointerP()

MK_PTR Sq3ValuePointerP ( SQ3_VALN sq3val,
MK_STRN arg1 )

Non-inline replacement for Sq3ValuePointer

◆ Sq3ValueStringR()

static MkStringR Sq3ValueStringR ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlobHide'

Attention
(do not free) The memory of the out/return value belongs to the called tclsq3lite function and therefore never becomes "MK_NULL" for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.

Definition at line 208 of file Sq3ValueC_sq3.h.

208 {
209 SQ3_INSTANCE_HDL(sq3val);
210
211 MK_STRN str = Sq3ValueText(sq3val);
212 MK_I32 len = Sq3ValueBytes(sq3val);
213 return MkStringCreate(len,str);
214}
#define str(s)
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
const MK_STRB * MK_STRN
static MK_STRN Sq3ValueText(SQ3_VALN sq3val)
Obtaining SQL Values …
+ Here is the caller graph for this function:

◆ Sq3ValueStringRP()

MkStringR Sq3ValueStringRP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueStringR

◆ Sq3ValueText()

static MK_STRN Sq3ValueText ( SQ3_VALN sq3val)
inlinestatic

Obtaining SQL Values …

read more at 'Sq3ValueBlob'

Definition at line 133 of file Sq3ValueC_sq3.h.

133 {
134 SQ3_INSTANCE_HDL(sq3val);
135 MK_STRN __retVal__L = (MK_STRN)sqlite3_value_text(sq3val->nat);
136 return __retVal__L;
137 }
+ Here is the caller graph for this function:

◆ Sq3ValueTextP()

MK_STRN Sq3ValueTextP ( SQ3_VALN sq3val)

Non-inline replacement for Sq3ValueText