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
Sq3LiteC_Misc_C_API

Sq3LiteC - various functions to perform misc operations … More...

+ Collaboration diagram for Sq3LiteC_Misc_C_API:

Macros

#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret   MK_U32
 
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args   MK_PTR arg0, MK_STRN arg1, MK_U32 arg2, MK_U32 arg3, MK_U32 arg4
 
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret   void
 
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args   MK_PTR arg0
 
#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret   MK_I32
 
#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_args   MK_PTR arg0, MK_I32 arg1, MK_PTRN arg2, MK_I32 arg3, MK_PTRN arg4
 
#define Sq3LiteVtabConfig(sq3lite, op, ...)
 Virtual Table Interface Configuration …
 

Typedefs

typedef Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret(* Sq3Fupu_Sq3LiteAutovacuumPages_arg1) (Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args)
 
typedef Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret(* Sq3Fupu_Sq3LiteAutovacuumPages_arg3) (Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args)
 
typedef Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret(* Sq3Fupu_Sq3LiteCreateCollation_xCompare) (Sq3Fupu_Sq3LiteCreateCollation_xCompare_args)
 

Functions

void Sq3LiteLog_RT (MK_RT mkrt, SQ3_LITEN const lite, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
 log the lite
 
static enum MkErrorE Sq3LiteAutovacuumPages (SQ3_LITE db, Sq3Fupu_Sq3LiteAutovacuumPages_arg1 arg1, MK_PTR arg2, Sq3Fupu_Sq3LiteAutovacuumPages_arg3 arg3)
 Autovacuum Compaction Amount Callback …
 
static enum MkErrorE Sq3LiteCreateCollation (SQ3_LITE sq3lite, MK_STRN zName, MK_I32 eTextRep, MK_PTR pArg, Sq3Fupu_Sq3LiteCreateCollation_xCompare xCompare)
 Define New Collating Sequences …
 
static enum MkErrorE Sq3LiteDbCacheflush (SQ3_LITE sq3lite)
 Flush caches to disk mid-transaction …
 
static SQ3_FILENAME Sq3LiteDbFilename (SQ3_LITE db, MK_STRN zDbName)
 Return The Filename For A Database Connection …
 
static MK_STRN Sq3LiteDbName (SQ3_LITE db, MK_I32 N)
 Return The Schema Name For A Database Connection …
 
static enum MkErrorE Sq3LiteDbReadonly (SQ3_LITE db, MK_STRN zDbName)
 Determine if a database is read-only …
 
static enum MkErrorE Sq3LiteDbReleaseMemory (SQ3_LITE sq3lite)
 Free Memory Used By A Database Connection …
 
static enum MkErrorE Sq3LiteDeserializeHide (SQ3_LITE db, MK_STRN zSchema, MK_BIN pData, MK_I64 szDb, MK_I64 szBuf, enum Sq3DeSerializeEF mFlags)
 Deserialize a database …
 
static enum MkErrorE Sq3LiteDropModulesHide (SQ3_LITE db, MK_STRN *azKeep)
 Remove Unnecessary Virtual Table Implementations …
 
static enum MkErrorE Sq3LiteFileControl (SQ3_LITE sq3lite, MK_STRN zDbName, enum Sq3TestCtrlE op, MK_PTR arg3)
 Low-Level Control Of Database Files …
 
static enum MkErrorE Sq3LiteOverloadFunction (SQ3_LITE sq3lite, MK_STRN zFuncName, MK_I32 nArg)
 Overload A Function For A Virtual Table …
 
static enum MkErrorE Sq3LiteDbStatus (SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_I32 *pCur, MK_I32 *pHiwtr, MK_BOOL resetFlg)
 Database Connection Status …
 
static MK_BIN Sq3LiteSerializeHide (SQ3_LITE db, MK_STRN zSchema, MK_I64 *piSize, enum Sq3SerializeE mFlags)
 Serialize a database …
 
static enum MkErrorE Sq3LiteTableColumnMetadata (SQ3_LITE db, MK_STRN zDbName, MK_STRN zTableName, MK_STRN zColumnName, MK_STRN *pzDataType, MK_STRN *pzCollSeq, MK_I32 *pNotNull, MK_I32 *pPrimaryKey, MK_I32 *pAutoinc)
 Extract Metadata About A Column Of A Table …
 
static MkBinaryR Sq3LiteSerialize (SQ3_LITE sq3lite, MK_STRN zSchema, enum Sq3SerializeE mFlags)
 Serialize a database …
 
static enum MkErrorE Sq3LiteDeserialize_RT (MK_RT mkrt, SQ3_LITE sq3lite, MK_STRN zSchema, MkBinaryR pData, enum Sq3DeSerializeEF mFlags)
 Deserialize a database …
 
enum MkErrorE Sq3LiteVtabConfig (SQ3_LITE sq3lite, Sq3VtabE op,...)
 This function may be called by either the [xConnect] or [xCreate] method of a [virtual table] implementation to configure various facets of the virtual table interface.
 
static enum MkErrorE Sq3LiteDbStatusBFL_RT (MK_RT mkrt, SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_BFL *val_out, MK_BOOL resetFlg)
 Database Connection Status …
 
enum MkErrorE Sq3LiteDropModules_RT (MK_RT mkrt, SQ3_LITE sq3lite, MK_BFL azKeepBfl)
 Remove Unnecessary Virtual Table Implementations …
 

Sq3LiteC - Sq3LiteC_Misc_C_API - function

enum MkErrorE Sq3LiteDbStatusBFLP (MK_RT mkrt, SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_BFL *val_out, MK_BOOL resetFlg)
 Non-inline replacement for Sq3LiteDbStatusBFL
 
enum MkErrorE Sq3LiteAutovacuumPagesP (SQ3_LITE db, Sq3Fupu_Sq3LiteAutovacuumPages_arg1 arg1, MK_PTR arg2, Sq3Fupu_Sq3LiteAutovacuumPages_arg3 arg3)
 Non-inline replacement for Sq3LiteAutovacuumPages
 
enum MkErrorE Sq3LiteCreateCollationP (SQ3_LITE sq3lite, MK_STRN zName, MK_I32 eTextRep, MK_PTR pArg, Sq3Fupu_Sq3LiteCreateCollation_xCompare xCompare)
 Non-inline replacement for Sq3LiteCreateCollation
 
enum MkErrorE Sq3LiteDbCacheflushP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteDbCacheflush
 
SQ3_FILENAME Sq3LiteDbFilenameP (SQ3_LITE db, MK_STRN zDbName)
 Non-inline replacement for Sq3LiteDbFilename
 
MK_STRN Sq3LiteDbNameP (SQ3_LITE db, MK_I32 N)
 Non-inline replacement for Sq3LiteDbName
 
enum MkErrorE Sq3LiteDbReadonlyP (SQ3_LITE db, MK_STRN zDbName)
 Non-inline replacement for Sq3LiteDbReadonly
 
enum MkErrorE Sq3LiteDbReleaseMemoryP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteDbReleaseMemory
 
enum MkErrorE Sq3LiteDeserializeP (MK_RT mkrt, SQ3_LITE sq3lite, MK_STRN zSchema, MkBinaryR pData, enum Sq3DeSerializeEF mFlags)
 Non-inline replacement for Sq3LiteDeserialize
 
enum MkErrorE Sq3LiteDeserializeHideP (SQ3_LITE db, MK_STRN zSchema, MK_BIN pData, MK_I64 szDb, MK_I64 szBuf, enum Sq3DeSerializeEF mFlags)
 Non-inline replacement for Sq3LiteDeserializeHide
 
enum MkErrorE Sq3LiteDropModulesHideP (SQ3_LITE db, MK_STRN *azKeep)
 Non-inline replacement for Sq3LiteDropModulesHide
 
enum MkErrorE Sq3LiteFileControlP (SQ3_LITE sq3lite, MK_STRN zDbName, enum Sq3TestCtrlE op, MK_PTR arg3)
 Non-inline replacement for Sq3LiteFileControl
 
enum MkErrorE Sq3LiteOverloadFunctionP (SQ3_LITE sq3lite, MK_STRN zFuncName, MK_I32 nArg)
 Non-inline replacement for Sq3LiteOverloadFunction
 
MkBinaryR Sq3LiteSerializeP (SQ3_LITE sq3lite, MK_STRN zSchema, enum Sq3SerializeE mFlags)
 Non-inline replacement for Sq3LiteSerialize
 
enum MkErrorE Sq3LiteDbStatusP (SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_I32 *pCur, MK_I32 *pHiwtr, MK_BOOL resetFlg)
 Non-inline replacement for Sq3LiteDbStatus
 
MK_BIN Sq3LiteSerializeHideP (SQ3_LITE db, MK_STRN zSchema, MK_I64 *piSize, enum Sq3SerializeE mFlags)
 Non-inline replacement for Sq3LiteSerializeHide
 
enum MkErrorE Sq3LiteTableColumnMetadataP (SQ3_LITE db, MK_STRN zDbName, MK_STRN zTableName, MK_STRN zColumnName, MK_STRN *pzDataType, MK_STRN *pzCollSeq, MK_I32 *pNotNull, MK_I32 *pPrimaryKey, MK_I32 *pAutoinc)
 Non-inline replacement for Sq3LiteTableColumnMetadata
 

Sq3LiteC - Sq3LiteC_Misc_C_API - overload

#define Sq3LiteDbStatusBFL_NULL(...)
 
#define Sq3LiteDbStatusBFL(...)
 
#define Sq3LiteDbStatusBFL_E(...)
 
#define Sq3LiteDbStatusBFL_C(...)
 
#define Sq3LiteAutovacuumPages_E(...)
 
#define Sq3LiteAutovacuumPages_C(...)
 
#define Sq3LiteCreateCollation_E(...)
 
#define Sq3LiteCreateCollation_C(...)
 
#define Sq3LiteDbCacheflush_E(...)
 
#define Sq3LiteDbCacheflush_C(...)
 
#define Sq3LiteDbReadonly_E(...)
 
#define Sq3LiteDbReadonly_C(...)
 
#define Sq3LiteDbReleaseMemory_E(...)
 
#define Sq3LiteDbReleaseMemory_C(...)
 
#define Sq3LiteDeserialize_NULL(...)
 
#define Sq3LiteDeserialize(...)
 
#define Sq3LiteDeserialize_E(...)
 
#define Sq3LiteDeserialize_C(...)
 
#define Sq3LiteDeserializeHide_5(db, zSchema, pData, szDb, szBuf)
 
#define Sq3LiteDeserializeHide_E(...)
 
#define Sq3LiteDeserializeHide_C(...)
 
#define Sq3LiteDropModules_NULL(...)
 
#define Sq3LiteDropModules(...)
 
#define Sq3LiteDropModules_E(...)
 
#define Sq3LiteDropModules_C(...)
 
#define Sq3LiteDropModulesHide_E(...)
 
#define Sq3LiteDropModulesHide_C(...)
 
#define Sq3LiteFileControl_E(...)
 
#define Sq3LiteFileControl_C(...)
 
#define Sq3LiteLog_NULL(...)
 
#define Sq3LiteLog(...)
 
#define Sq3LiteLog_4(lite, fmtobj, debug, callfunc)
 
#define Sq3LiteLog_3(lite, fmtobj, debug)
 
#define Sq3LiteLog_2(lite, fmtobj)
 
#define Sq3LiteLog_1(lite)
 
#define Sq3LiteOverloadFunction_E(...)
 
#define Sq3LiteOverloadFunction_C(...)
 
#define Sq3LiteVtabConfig_E(...)
 
#define Sq3LiteVtabConfig_C(...)
 
#define Sq3LiteDbStatus_E(...)
 
#define Sq3LiteDbStatus_C(...)
 
#define Sq3LiteSerializeHide_3(db, zSchema, piSize)
 
#define Sq3LiteSerializeHide_2(db, zSchema)
 
#define Sq3LiteTableColumnMetadata_E(...)
 
#define Sq3LiteTableColumnMetadata_C(...)
 

Detailed Description

Sq3LiteC - various functions to perform misc operations …

Macro Definition Documentation

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args

#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args   MK_PTR arg0, MK_STRN arg1, MK_U32 arg2, MK_U32 arg3, MK_U32 arg4

Definition at line 104 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret

#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret   MK_U32

Definition at line 103 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args

#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args   MK_PTR arg0

Definition at line 111 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret

#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret   void

Definition at line 110 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCreateCollation_xCompare_args

#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_args   MK_PTR arg0, MK_I32 arg1, MK_PTRN arg2, MK_I32 arg3, MK_PTRN arg4

Definition at line 118 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret

#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret   MK_I32

Definition at line 117 of file Sq3LiteC_sq3.h.

◆ Sq3LiteAutovacuumPages_C

#define Sq3LiteAutovacuumPages_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteAutovacuumPages(__VA_ARGS__)))
static enum MkErrorE Sq3LiteAutovacuumPages(SQ3_LITE db, Sq3Fupu_Sq3LiteAutovacuumPages_arg1 arg1, MK_PTR arg2, Sq3Fupu_Sq3LiteAutovacuumPages_arg3 arg3)
Autovacuum Compaction Amount Callback …

Definition at line 432 of file sqlite3_overload_sq3.h.

◆ Sq3LiteAutovacuumPages_E

#define Sq3LiteAutovacuumPages_E ( ...)
Value:
MkErrorCheck(Sq3LiteAutovacuumPages(__VA_ARGS__))

Definition at line 431 of file sqlite3_overload_sq3.h.

◆ Sq3LiteCreateCollation_C

#define Sq3LiteCreateCollation_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteCreateCollation(__VA_ARGS__)))
static enum MkErrorE Sq3LiteCreateCollation(SQ3_LITE sq3lite, MK_STRN zName, MK_I32 eTextRep, MK_PTR pArg, Sq3Fupu_Sq3LiteCreateCollation_xCompare xCompare)
Define New Collating Sequences …

Definition at line 434 of file sqlite3_overload_sq3.h.

◆ Sq3LiteCreateCollation_E

#define Sq3LiteCreateCollation_E ( ...)
Value:
MkErrorCheck(Sq3LiteCreateCollation(__VA_ARGS__))

Definition at line 433 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbCacheflush_C

#define Sq3LiteDbCacheflush_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDbCacheflush(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDbCacheflush(SQ3_LITE sq3lite)
Flush caches to disk mid-transaction …

Definition at line 436 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbCacheflush_E

#define Sq3LiteDbCacheflush_E ( ...)
Value:
MkErrorCheck(Sq3LiteDbCacheflush(__VA_ARGS__))

Definition at line 435 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbReadonly_C

#define Sq3LiteDbReadonly_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDbReadonly(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDbReadonly(SQ3_LITE db, MK_STRN zDbName)
Determine if a database is read-only …

Definition at line 438 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbReadonly_E

#define Sq3LiteDbReadonly_E ( ...)
Value:
MkErrorCheck(Sq3LiteDbReadonly(__VA_ARGS__))

Definition at line 437 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbReleaseMemory_C

#define Sq3LiteDbReleaseMemory_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDbReleaseMemory(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDbReleaseMemory(SQ3_LITE sq3lite)
Free Memory Used By A Database Connection …

Definition at line 440 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbReleaseMemory_E

#define Sq3LiteDbReleaseMemory_E ( ...)
Value:
MkErrorCheck(Sq3LiteDbReleaseMemory(__VA_ARGS__))

Definition at line 439 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatus_C

#define Sq3LiteDbStatus_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDbStatus(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDbStatus(SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_I32 *pCur, MK_I32 *pHiwtr, MK_BOOL resetFlg)
Database Connection Status …

Definition at line 469 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatus_E

#define Sq3LiteDbStatus_E ( ...)
Value:
MkErrorCheck(Sq3LiteDbStatus(__VA_ARGS__))

Definition at line 468 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatusBFL

#define Sq3LiteDbStatusBFL ( ...)
Value:
#define MK_RT_CALL
static enum MkErrorE Sq3LiteDbStatusBFL_RT(MK_RT mkrt, SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_BFL *val_out, MK_BOOL resetFlg)
Database Connection Status …

Definition at line 426 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatusBFL_C

#define Sq3LiteDbStatusBFL_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDbStatusBFL(__VA_ARGS__)))
#define Sq3LiteDbStatusBFL(...)

Definition at line 428 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatusBFL_E

#define Sq3LiteDbStatusBFL_E ( ...)
Value:
MkErrorCheck(Sq3LiteDbStatusBFL(__VA_ARGS__))

Definition at line 427 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDbStatusBFL_NULL

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

Definition at line 425 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserialize

#define Sq3LiteDeserialize ( ...)
Value:
static enum MkErrorE Sq3LiteDeserialize_RT(MK_RT mkrt, SQ3_LITE sq3lite, MK_STRN zSchema, MkBinaryR pData, enum Sq3DeSerializeEF mFlags)
Deserialize a database …

Definition at line 442 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserialize_C

#define Sq3LiteDeserialize_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDeserialize(__VA_ARGS__)))
#define Sq3LiteDeserialize(...)

Definition at line 444 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserialize_E

#define Sq3LiteDeserialize_E ( ...)
Value:
MkErrorCheck(Sq3LiteDeserialize(__VA_ARGS__))

Definition at line 443 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserialize_NULL

#define Sq3LiteDeserialize_NULL ( ...)
Value:

Definition at line 441 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserializeHide_5

#define Sq3LiteDeserializeHide_5 ( db,
zSchema,
pData,
szDb,
szBuf )
Value:
Sq3LiteDeserializeHide(db,zSchema,pData,szDb,szBuf,SQ3_DESERIALIZE_NO)
static enum MkErrorE Sq3LiteDeserializeHide(SQ3_LITE db, MK_STRN zSchema, MK_BIN pData, MK_I64 szDb, MK_I64 szBuf, enum Sq3DeSerializeEF mFlags)
Deserialize a database …
@ SQ3_DESERIALIZE_NO

Definition at line 445 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserializeHide_C

#define Sq3LiteDeserializeHide_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDeserializeHide(__VA_ARGS__)))

Definition at line 447 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeserializeHide_E

#define Sq3LiteDeserializeHide_E ( ...)
Value:
MkErrorCheck(Sq3LiteDeserializeHide(__VA_ARGS__))

Definition at line 446 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModules

#define Sq3LiteDropModules ( ...)
Value:
enum MkErrorE Sq3LiteDropModules_RT(MK_RT mkrt, SQ3_LITE sq3lite, MK_BFL azKeepBfl)
Remove Unnecessary Virtual Table Implementations …

Definition at line 449 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModules_C

#define Sq3LiteDropModules_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDropModules(__VA_ARGS__)))
#define Sq3LiteDropModules(...)

Definition at line 451 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModules_E

#define Sq3LiteDropModules_E ( ...)
Value:
MkErrorCheck(Sq3LiteDropModules(__VA_ARGS__))

Definition at line 450 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModules_NULL

#define Sq3LiteDropModules_NULL ( ...)
Value:

Definition at line 448 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModulesHide_C

#define Sq3LiteDropModulesHide_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDropModulesHide(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDropModulesHide(SQ3_LITE db, MK_STRN *azKeep)
Remove Unnecessary Virtual Table Implementations …

Definition at line 453 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDropModulesHide_E

#define Sq3LiteDropModulesHide_E ( ...)
Value:
MkErrorCheck(Sq3LiteDropModulesHide(__VA_ARGS__))

Definition at line 452 of file sqlite3_overload_sq3.h.

◆ Sq3LiteFileControl_C

#define Sq3LiteFileControl_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteFileControl(__VA_ARGS__)))
static enum MkErrorE Sq3LiteFileControl(SQ3_LITE sq3lite, MK_STRN zDbName, enum Sq3TestCtrlE op, MK_PTR arg3)
Low-Level Control Of Database Files …

Definition at line 455 of file sqlite3_overload_sq3.h.

◆ Sq3LiteFileControl_E

#define Sq3LiteFileControl_E ( ...)
Value:
MkErrorCheck(Sq3LiteFileControl(__VA_ARGS__))

Definition at line 454 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog

#define Sq3LiteLog ( ...)
Value:
void Sq3LiteLog_RT(MK_RT mkrt, SQ3_LITEN const lite, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl)
log the lite …

Definition at line 457 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog_1

#define Sq3LiteLog_1 ( lite)
Value:
Sq3LiteLog(lite,NULL,0,__func__,0)
#define Sq3LiteLog(...)

Definition at line 461 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog_2

#define Sq3LiteLog_2 ( lite,
fmtobj )
Value:
Sq3LiteLog(lite,fmtobj,0,__func__,0)

Definition at line 460 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog_3

#define Sq3LiteLog_3 ( lite,
fmtobj,
debug )
Value:
Sq3LiteLog(lite,fmtobj,debug,__func__,0)

Definition at line 459 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog_4

#define Sq3LiteLog_4 ( lite,
fmtobj,
debug,
callfunc )
Value:
Sq3LiteLog(lite,fmtobj,debug,callfunc,0)

Definition at line 458 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLog_NULL

#define Sq3LiteLog_NULL ( ...)
Value:

Definition at line 456 of file sqlite3_overload_sq3.h.

◆ Sq3LiteOverloadFunction_C

#define Sq3LiteOverloadFunction_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteOverloadFunction(__VA_ARGS__)))
static enum MkErrorE Sq3LiteOverloadFunction(SQ3_LITE sq3lite, MK_STRN zFuncName, MK_I32 nArg)
Overload A Function For A Virtual Table …

Definition at line 463 of file sqlite3_overload_sq3.h.

◆ Sq3LiteOverloadFunction_E

#define Sq3LiteOverloadFunction_E ( ...)
Value:
MkErrorCheck(Sq3LiteOverloadFunction(__VA_ARGS__))

Definition at line 462 of file sqlite3_overload_sq3.h.

◆ Sq3LiteSerializeHide_2

#define Sq3LiteSerializeHide_2 ( db,
zSchema )
Value:
static MK_BIN Sq3LiteSerializeHide(SQ3_LITE db, MK_STRN zSchema, MK_I64 *piSize, enum Sq3SerializeE mFlags)
Serialize a database …
@ SQ3_SERIALIZE_NO

Definition at line 471 of file sqlite3_overload_sq3.h.

◆ Sq3LiteSerializeHide_3

#define Sq3LiteSerializeHide_3 ( db,
zSchema,
piSize )
Value:

Definition at line 470 of file sqlite3_overload_sq3.h.

◆ Sq3LiteTableColumnMetadata_C

#define Sq3LiteTableColumnMetadata_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteTableColumnMetadata(__VA_ARGS__)))
static enum MkErrorE Sq3LiteTableColumnMetadata(SQ3_LITE db, MK_STRN zDbName, MK_STRN zTableName, MK_STRN zColumnName, MK_STRN *pzDataType, MK_STRN *pzCollSeq, MK_I32 *pNotNull, MK_I32 *pPrimaryKey, MK_I32 *pAutoinc)
Extract Metadata About A Column Of A Table …

Definition at line 473 of file sqlite3_overload_sq3.h.

◆ Sq3LiteTableColumnMetadata_E

#define Sq3LiteTableColumnMetadata_E ( ...)
Value:
MkErrorCheck(Sq3LiteTableColumnMetadata(__VA_ARGS__))

Definition at line 472 of file sqlite3_overload_sq3.h.

◆ Sq3LiteVtabConfig

#define Sq3LiteVtabConfig ( sq3lite,
op,
... )
Value:
({ \
Sq3ErrorE errVal = sqlite3_vtab_config(sq3lite->nat, op, __VA_ARGS__); \
Sq3ErrorE_Check_Macro(sq3lite,errVal); \
if (unlikely(Sq3ErrorCheckI(errVal))) { \
Sq3LiteErrorToMQ(MkOBJ(sq3lite), __func__,__FILE__,__LINE__); \
} else { \
MK_OK; \
} \
})
#define unlikely(x)
MK_ERROR
MK_OK
#define MkOBJ(x)
Sq3ErrorE
Result Codes.
static bool Sq3ErrorCheckI(enum Sq3ErrorE ret)
check if ret signal an error …
SQLITE_API int sqlite3_vtab_config(sqlite3 *, int op,...)

Virtual Table Interface Configuration …

This function may be called by either the xConnect or xCreate method of a virtual table implementation to configure various facets of the virtual table interface.

If this interface is invoked outside the context of an xConnect or xCreate virtual table method then the behavior is undefined.

In the call Sq3LiteVtabConfig(D,C,...) the D parameter is the database connection in which the virtual table is being created and which is passed in as the first argument to the xConnect or xCreate method that is invoking Sq3LiteVtabConfig(). The C parameter is one of the virtual table configuration options. The presence and meaning of parameters after C depend on which virtual table configuration option is used.

Reference code from sqlite3:

struct sqlite3 sqlite3
#define SQLITE_API

Definition at line 635 of file Sq3LiteC_sq3.h.

635#define Sq3LiteVtabConfig(sq3lite, op, ...) ({ \
636 Sq3ErrorE errVal = sqlite3_vtab_config(sq3lite->nat, op, __VA_ARGS__); \
637 Sq3ErrorE_Check_Macro(sq3lite,errVal); \
638 if (unlikely(Sq3ErrorCheckI(errVal))) { \
639 Sq3LiteErrorToMQ(MkOBJ(sq3lite), __func__,__FILE__,__LINE__); \
640 MK_ERROR; \
641 } else { \
642 MK_OK; \
643 } \
644})

◆ Sq3LiteVtabConfig_C

#define Sq3LiteVtabConfig_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteVtabConfig(__VA_ARGS__)))
#define Sq3LiteVtabConfig(sq3lite, op,...)
Virtual Table Interface Configuration …

Definition at line 465 of file sqlite3_overload_sq3.h.

◆ Sq3LiteVtabConfig_E

#define Sq3LiteVtabConfig_E ( ...)
Value:
MkErrorCheck(Sq3LiteVtabConfig(__VA_ARGS__))

Definition at line 464 of file sqlite3_overload_sq3.h.

Typedef Documentation

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg1

Definition at line 105 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteAutovacuumPages_arg3

Definition at line 112 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCreateCollation_xCompare

Definition at line 119 of file Sq3LiteC_sq3.h.

Function Documentation

◆ Sq3LiteAutovacuumPages()

static enum MkErrorE Sq3LiteAutovacuumPages ( SQ3_LITE db,
Sq3Fupu_Sq3LiteAutovacuumPages_arg1 arg1,
MK_PTR arg2,
Sq3Fupu_Sq3LiteAutovacuumPages_arg3 arg3 )
inlinestatic

Autovacuum Compaction Amount Callback …

The Sq3LiteAutovacuumPages(D,C,P,X) interface registers a callback function C that is invoked prior to each autovacuum of the database file. The callback is passed a copy of the generic data pointer (P), the schema-name of the attached database that is being autovacuumed, the size of the database file in pages, the number of free pages, and the number of bytes per page, respectively. The callback should return the number of free pages that should be removed by the autovacuum. If the callback returns zero, then no autovacuum happens. If the value returned is greater than or equal to the number of free pages, then a complete autovacuum happens.

If there are multiple ATTACH-ed database files that are being modified as part of a transaction commit, then the autovacuum pages callback is invoked separately for each file.

The callback is not reentrant. The callback function should not attempt to invoke any other SQLite interface. If it does, bad things may happen, including segmentation faults and corrupt database files. The callback function should be a simple function that does some arithmetic on its input parameters and returns a result.

The X parameter to Sq3LiteAutovacuumPages(D,C,P,X) is an optional destructor for the P parameter. If X is not NULL, then X(P) is invoked whenever the database connection closes or when the callback is overwritten by another invocation of Sq3LiteAutovacuumPages().

There is only one autovacuum pages callback per database connection. Each call to the Sq3LiteAutovacuumPages() interface overrides all previous invocations for that database connection. If the callback argument (C) to Sq3LiteAutovacuumPages(D,C,P,X) is a NULL pointer, then the autovacuum steps callback is canceled. The return value from Sq3LiteAutovacuumPages() is normally SQ3_RESULT_OK, but might be some other error code if something goes wrong. The current implementation will only return SQ3_RESULT_OK or SQ3_RESULT_MISUSE, but other return codes might be added in future releases.

If no autovacuum pages callback is specified (the usual case) or a NULL pointer is provided for the callback, then the default behavior is to vacuum all free pages. So, in other words, the default behavior is the same as if the callback function were something like this:

    unsigned int demonstration_autovac_pages_callback(
      void *pClientData,
      const char *zSchema,
      unsigned int nDbPage,
      unsigned int nFreePage,
      unsigned int nBytePerPage
    ){
      return nFreePage;
    }

Reference code from sqlite3:

sqlite3 *db,
unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
void*,
void(*)(void*)
);
SQLITE_API int sqlite3_autovacuum_pages(sqlite3 *db, unsigned int(*)(void *, const char *, unsigned int, unsigned int, unsigned int), void *, void(*)(void *))

Definition at line 321 of file Sq3LiteC_sq3.h.

321 {
323 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_autovacuum_pages(db->nat, arg1, (MK_PTR)(arg2), arg3);
324 Sq3ErrorE_Check(db, errVal);
325 return MK_OK;
326 error:
327 return MK_ERROR;
328 }
MK_PTRB * MK_PTR
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a jvsq3lite error and convert into a jvsq3lite error …
#define SQ3_INSTANCE_HDL(x)
sqlite3 * nat
internal - link between Sq3LiteS and native library

◆ Sq3LiteAutovacuumPagesP()

Non-inline replacement for Sq3LiteAutovacuumPages

◆ Sq3LiteCreateCollation()

static enum MkErrorE Sq3LiteCreateCollation ( SQ3_LITE sq3lite,
MK_STRN zName,
MK_I32 eTextRep,
MK_PTR pArg,
Sq3Fupu_Sq3LiteCreateCollation_xCompare xCompare )
inlinestatic

Define New Collating Sequences …

These functions add, remove, or modify a collation associated with the database connection specified as the first argument.

The name of the collation is a UTF-8 string for Sq3LiteCreateCollation() and sqlite3_create_collation_v2() and a UTF-16 string in native byte order for sqlite3_create_collation16(). Collation names that compare equal according to Sq3StrNicmp () are considered to be the same name.

The third argument (eTextRep) must be one of the constants:

The eTextRep argument determines the encoding of strings passed to the collating function callback, xCompare. The SQ3_TEXT_UTF16 and SQ3_TEXT_UTF16_ALIGNED values for eTextRep force strings to be UTF16 with native byte order. The SQ3_TEXT_UTF16_ALIGNED value for eTextRep forces strings to begin on an even byte address.

The fourth argument, pArg, is an application data pointer that is passed through as the first argument to the collating function callback.

The fifth argument, xCompare, is a pointer to the collating function. Multiple collating functions can be registered using the same name but with different eTextRep parameters and SQLite will use whichever function requires the least amount of data transformation. If the xCompare argument is NULL then the collating function is deleted. When all collating functions having the same name are deleted, that collation is no longer usable.

The collating function callback is invoked with a copy of the pArg application data pointer and with two strings in the encoding specified by the eTextRep argument. The two integer parameters to the collating function callback are the length of the two strings, in bytes. The collating function must return an integer that is negative, zero, or positive if the first string is less than, equal to, or greater than the second, respectively. A collating function must always return the same answer given the same inputs. If two or more collating functions are registered to the same collation name (using different eTextRep values) then all must give an equivalent answer when invoked with equivalent strings. The collating function must obey the following properties for all strings A, B, and C:

  1. If A==B then B==A.
  2. If A==B and B==C then A==C.
  3. If A<B THEN B>A.
  4. If A<B and B<C then A<C.

If a collating function fails any of the above constraints and that collating function is registered and used, then the behavior of SQLite is undefined.

The sqlite3_create_collation_v2() works like Sq3LiteCreateCollation() with the addition that the xDestroy callback is invoked on pArg when the collating function is deleted. Collating functions are deleted when they are overridden by later calls to the collation creation functions or when the database connection is closed using sqlite3_close ().

The xDestroy callback is not called if the sqlite3_create_collation_v2() function fails. Applications that invoke sqlite3_create_collation_v2() with a non-NULL xDestroy argument should check the return code and dispose of the application data pointer themselves rather than expecting SQLite to deal with it for them. This is different from every other SQLite interface. The inconsistency is unfortunate but cannot be changed without breaking backwards compatibility.

See also: sqlite3_collation_needed () and sqlite3_collation_needed16 ().

Reference code from sqlite3:

const char *zName,
int eTextRep,
void *pArg,
int(*xCompare)(void*,int,const void*,int,const void*)
);
const char *zName,
int eTextRep,
void *pArg,
int(*xCompare)(void*,int,const void*,int,const void*),
void(*xDestroy)(void*)
);
const void *zName,
int eTextRep,
void *pArg,
int(*xCompare)(void*,int,const void*,int,const void*)
);
SQLITE_API int sqlite3_create_collation16(sqlite3 *, const void *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))
SQLITE_API int sqlite3_create_collation_v2(sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *), void(*xDestroy)(void *))
SQLITE_API int sqlite3_create_collation(sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))

Definition at line 331 of file Sq3LiteC_sq3.h.

331 {
332 SQ3_INSTANCE_HDL(sq3lite);
333 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_create_collation(sq3lite->nat, zName, eTextRep, (MK_PTR)(pArg), xCompare);
334 Sq3ErrorE_Check(sq3lite, errVal);
335 return MK_OK;
336 error:
337 return MK_ERROR;
338 }

◆ Sq3LiteCreateCollationP()

enum MkErrorE Sq3LiteCreateCollationP ( SQ3_LITE sq3lite,
MK_STRN zName,
MK_I32 eTextRep,
MK_PTR pArg,
Sq3Fupu_Sq3LiteCreateCollation_xCompare xCompare )

Non-inline replacement for Sq3LiteCreateCollation

◆ Sq3LiteDbCacheflush()

static enum MkErrorE Sq3LiteDbCacheflush ( SQ3_LITE sq3lite)
inlinestatic

Flush caches to disk mid-transaction …

If a write-transaction is open on database connection D when the Sq3LiteDbCacheflush (D) interface invoked, any dirty pages in the pager-cache that are not currently in use are written out to disk. A dirty page may be in use if a database cursor created by an active SQL statement is reading from it, or if it is page 1 of a database file (page 1 is always "in use"). The Sq3LiteDbCacheflush (D) interface flushes caches for all schemas - "main", "temp", and any attached databases.

If this function needs to obtain extra database locks before dirty pages can be flushed to disk, it does so. If those locks cannot be obtained immediately and there is a busy-handler callback configured, it is invoked in the usual manner. If the required lock still cannot be obtained, then the database is skipped and an attempt made to flush any dirty pages belonging to the next (if any) database. If any databases are skipped because locks cannot be obtained, but no other error occurs, this function returns SQ3_RESULT_BUSY.

If any other error occurs while flushing dirty pages to disk (for example an IO error or out-of-memory condition), then processing is abandoned and an SQLite error code is returned to the caller immediately.

Otherwise, if no error occurs, Sq3LiteDbCacheflush () returns SQ3_RESULT_OK.

This function does not set the database handle error code or message returned by the Sq3LiteErrCode () and Sq3LiteErrMsg () functions.

Reference code from sqlite3:

SQLITE_API int sqlite3_db_cacheflush(sqlite3 *)

Definition at line 341 of file Sq3LiteC_sq3.h.

341 {
342 SQ3_INSTANCE_HDL(sq3lite);
343 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_db_cacheflush(sq3lite->nat);
344 Sq3ErrorE_Check(sq3lite, errVal);
345 return MK_OK;
346 error:
347 return MK_ERROR;
348 }
+ Here is the caller graph for this function:

◆ Sq3LiteDbCacheflushP()

enum MkErrorE Sq3LiteDbCacheflushP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteDbCacheflush

◆ Sq3LiteDbFilename()

static SQ3_FILENAME Sq3LiteDbFilename ( SQ3_LITE db,
MK_STRN zDbName )
inlinestatic

Return The Filename For A Database Connection …

The Sq3LiteDbFilename(D,N) interface returns a pointer to the filename associated with database N of connection D. If there is no attached database N on the database connection D, or if database N is a temporary or in-memory database, then this function will return either a NULL pointer or an empty string.

The string value returned by this routine is owned and managed by the database connection. The value will be valid until the database N is DETACH-ed or until the database connection closes.

The filename returned by this function is the output of the xFullPathname method of the VFS. In other words, the filename will be an absolute pathname, even if the filename used to open the database originally was a URI or relative pathname.

If the filename pointer returned by this routine is not NULL, then it can be used as the filename input parameter to these routines:

Reference code from sqlite3:

const char * sqlite3_filename
SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName)

Definition at line 351 of file Sq3LiteC_sq3.h.

351 {
353 SQ3_FILENAME __retVal__L = sqlite3_db_filename(db->nat, zDbName);
354 return __retVal__L;
355 }
+ Here is the caller graph for this function:

◆ Sq3LiteDbFilenameP()

SQ3_FILENAME Sq3LiteDbFilenameP ( SQ3_LITE db,
MK_STRN zDbName )

Non-inline replacement for Sq3LiteDbFilename

◆ Sq3LiteDbName()

static MK_STRN Sq3LiteDbName ( SQ3_LITE db,
MK_I32 N )
inlinestatic

Return The Schema Name For A Database Connection …

The Sq3LiteDbName(D,N) interface returns a pointer to the schema name for the N-th database on database connection D, or a NULL pointer of N is out of range. An N value of 0 means the main database file. An N of 1 is the "temp" schema. Larger values of N correspond to various ATTACH-ed databases.

Space to hold the string that is returned by Sq3LiteDbName() is managed by SQLite itself. The string might be deallocated by any operation that changes the schema, including ATTACH or DETACH or calls to Sq3LiteSerialize () or Sq3LiteDeserialize (), even operations that occur on a different thread. Applications that need to remember the string long-term should make their own copy. Applications that are accessing the same database connection simultaneously on multiple threads should mutex-protect calls to this API and should make their own private copy of the result prior to releasing the mutex.

Reference code from sqlite3:

SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);
SQLITE_API const char * sqlite3_db_name(sqlite3 *db, int N)

Definition at line 358 of file Sq3LiteC_sq3.h.

358 {
360 MK_STRN __retVal__L = sqlite3_db_name(db->nat, N);
361 return __retVal__L;
362 }
const MK_STRB * MK_STRN
+ Here is the caller graph for this function:

◆ Sq3LiteDbNameP()

MK_STRN Sq3LiteDbNameP ( SQ3_LITE db,
MK_I32 N )

Non-inline replacement for Sq3LiteDbName

◆ Sq3LiteDbReadonly()

static enum MkErrorE Sq3LiteDbReadonly ( SQ3_LITE db,
MK_STRN zDbName )
inlinestatic

Determine if a database is read-only …

The Sq3LiteDbReadonly(D,N) interface returns 1 if the database N of connection D is read-only, 0 if it is read/write, or -1 if N is not the name of a database on connection D.

Reference code from sqlite3:

SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName)

Definition at line 365 of file Sq3LiteC_sq3.h.

365 {
367 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_db_readonly(db->nat, zDbName);
368 Sq3ErrorE_Check(db, errVal);
369 return MK_OK;
370 error:
371 return MK_ERROR;
372 }
+ Here is the caller graph for this function:

◆ Sq3LiteDbReadonlyP()

enum MkErrorE Sq3LiteDbReadonlyP ( SQ3_LITE db,
MK_STRN zDbName )

Non-inline replacement for Sq3LiteDbReadonly

◆ Sq3LiteDbReleaseMemory()

static enum MkErrorE Sq3LiteDbReleaseMemory ( SQ3_LITE sq3lite)
inlinestatic

Free Memory Used By A Database Connection …

The Sq3LiteDbReleaseMemory(D) interface attempts to free as much heap memory as possible from database connection D. Unlike the Sq3ReleaseMemory () interface, this interface is in effect even when the SQLITE_ENABLE_MEMORY_MANAGEMENT compile-time option is omitted.

See also: Sq3ReleaseMemory ()

Reference code from sqlite3:

SQLITE_API int sqlite3_db_release_memory(sqlite3 *)

Definition at line 375 of file Sq3LiteC_sq3.h.

375 {
376 SQ3_INSTANCE_HDL(sq3lite);
377 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_db_release_memory(sq3lite->nat);
378 Sq3ErrorE_Check(sq3lite, errVal);
379 return MK_OK;
380 error:
381 return MK_ERROR;
382 }
+ Here is the caller graph for this function:

◆ Sq3LiteDbReleaseMemoryP()

enum MkErrorE Sq3LiteDbReleaseMemoryP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteDbReleaseMemory

◆ Sq3LiteDbStatus()

static enum MkErrorE Sq3LiteDbStatus ( SQ3_LITE sq3lite,
enum Sq3DbStatusE op,
MK_I32 * pCur,
MK_I32 * pHiwtr,
MK_BOOL resetFlg )
inlinestatic

Database Connection Status …

This interface is used to retrieve runtime status information about a single database connection. The first argument is the database connection object to be interrogated. The second argument is an integer constant, taken from the set of SQ3_DBSTATUS options, that determines the parameter to interrogate. The set of SQ3_DBSTATUS options is likely to grow in future releases of SQLite.

The current value of the requested parameter is written into *pCur and the highest instantaneous value is written into *pHiwtr. If the resetFlg is true, then the highest instantaneous value is reset back down to the current value.

The Sq3LiteDbStatus() routine returns SQ3_RESULT_OK on success and a non-zero error code on failure.

See also: Sq3Status () and Sq3StmtStatus ().

Reference code from sqlite3:

SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
SQLITE_API int sqlite3_db_status(sqlite3 *, int op, int *pCur, int *pHiwtr, int resetFlg)

Definition at line 427 of file Sq3LiteC_sq3.h.

427 {
428 SQ3_INSTANCE_HDL(sq3lite);
429 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_db_status(sq3lite->nat, op, pCur, pHiwtr, resetFlg);
430 Sq3ErrorE_Check(sq3lite, errVal);
431 return MK_OK;
432 error:
433 return MK_ERROR;
434 }
+ Here is the caller graph for this function:

◆ Sq3LiteDbStatusBFL_RT()

static enum MkErrorE Sq3LiteDbStatusBFL_RT ( MK_RT mkrt,
SQ3_LITE sq3lite,
enum Sq3DbStatusE op,
MK_BFL * val_out,
MK_BOOL resetFlg )
inlinestatic

Database Connection Status …

This interface is used to retrieve runtime status information about a single database connection. The first argument is the database connection object to be interrogated. The second argument is an integer constant, taken from the set of SQ3_DBSTATUS options, that determines the parameter to interrogate. The set of SQ3_DBSTATUS options is likely to grow in future releases of SQLite.

The current value of the requested parameter is written into *pCur and the highest instantaneous value is written into *pHiwtr. If the resetFlg is true, then the highest instantaneous value is reset back down to the current value.

The Sq3LiteDbStatus() routine returns SQ3_RESULT_OK on success and a non-zero error code on failure.

See also: Sq3Status () and Sq3StmtStatus ().

Reference code from sqlite3:

SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sq3litethe Sq3LiteC instance to work on a database
[in]opa value from the enum Sq3DbStatusE
[out]val_outThe return-value have to be none null.
[in]resetFlgIf the resetFlg is true, then the highest instantaneous value is reset back down to the current value.
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
Attention
(do not free) The memory of the val_out value belongs to the called Sq3LiteDbStatusBFL function and therefore never becomes null for a non-error result.
For details on the val_out value, see: MkKernel_Storage_C_API.

Definition at line 658 of file Sq3LiteC_sq3.h.

664 {
665 assert(val_out != NULL);
666 SQ3_INSTANCE_RT_X(sq3lite);
667
669 MK_I32 pCur;
670 MK_I32 pHiwtr;
671 Sq3LiteDbStatus_E(sq3lite,op,&pCur,&pHiwtr,resetFlg);
672 MkBufferListAppendI32(bfl,pCur);
673 MkBufferListAppendI32(bfl,pHiwtr);
674 *val_out = bfl;
675 MkErrorReturnLabel(sq3lite);
676}
#define MkBufferListAppendI32(...)
#define MkBufferListCreateTLS_T(name, num)
signed int MK_I32
#define Sq3LiteDbStatus_E(...)
#define SQ3_INSTANCE_RT_X(x)

◆ Sq3LiteDbStatusBFLP()

enum MkErrorE Sq3LiteDbStatusBFLP ( MK_RT mkrt,
SQ3_LITE sq3lite,
enum Sq3DbStatusE op,
MK_BFL * val_out,
MK_BOOL resetFlg )

Non-inline replacement for Sq3LiteDbStatusBFL

◆ Sq3LiteDbStatusP()

enum MkErrorE Sq3LiteDbStatusP ( SQ3_LITE sq3lite,
enum Sq3DbStatusE op,
MK_I32 * pCur,
MK_I32 * pHiwtr,
MK_BOOL resetFlg )

Non-inline replacement for Sq3LiteDbStatus

◆ Sq3LiteDeserialize_RT()

static enum MkErrorE Sq3LiteDeserialize_RT ( MK_RT mkrt,
SQ3_LITE sq3lite,
MK_STRN zSchema,
MkBinaryR pData,
enum Sq3DeSerializeEF mFlags )
inlinestatic

Deserialize a database …

This is an enhanced version of Sq3LiteDeserializeHide, the return value changed to MkBinaryR.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sq3litethe Sq3LiteC instance to work on a database
[in]zSchemaWhich DB to reopen with the deserialization
[in]pDataThe serialized database content
[in]mFlagsZero or more Sq3SerializeE flags
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

Sq3LiteDeserializeHide : documentation

Deserialize a database …
The Sq3LiteDeserialize(D,S,P,N,M,F) interface causes the database connection D to disconnect from database S and then reopen S as an in-memory database based on the serialization contained in P. The serialized database P is N bytes in size. M is the size of the buffer P, which might be larger than N. If M is larger than N, and the SQ3_DESERIALIZE_READONLY bit is not set in F, then SQLite is permitted to add content to the in-memory database as long as the total size does not exceed M bytes.
If the SQ3_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will invoke Sq3Free() on the serialization buffer when the database connection closes. If the SQ3_DESERIALIZE_RESIZEABLE bit is set, then SQLite will try to increase the buffer size using Sq3Realloc64() if writes on the database cause it to grow larger than M bytes.
Applications must not modify the buffer P or invalidate it before the database connection D is closed.
The Sq3LiteDeserialize() interface will fail with SQ3_RESULT_BUSY if the database is currently in a read transaction or is involved in a backup operation.
It is not possible to deserialized into the TEMP database. If the S argument to Sq3LiteDeserialize(D,S,P,N,M,F) is "temp" then the function returns SQ3_RESULT_ERROR.
The deserialized database should not be in WAL mode. If the database is in WAL mode, then any attempt to use the database file will result in an SQ3_RESULT_CANTOPEN error. The application can set the file format version numbers (bytes 18 and 19) of the input database P to 0x01 prior to invoking Sq3LiteDeserialize(D,S,P,N,M,F) to force the database file into rollback mode and work around this limitation.
If Sq3LiteDeserialize(D,S,P,N,M,F) fails for any reason and if the SQ3_DESERIALIZE_FREEONCLOSE bit is set in argument F, then Sq3Free () is invoked on argument P prior to returning.
This interface is omitted if SQLite is compiled with the SQLITE_OMIT_DESERIALIZE option.
Reference code from sqlite3:
sqlite3 *db, // The database connection
const char *zSchema, // Which DB to reopen with the deserialization
unsigned char *pData, // The serialized database content
sqlite3_int64 szDb, // Number bytes in the deserialization
sqlite3_int64 szBuf, // Total size of buffer pData[]
unsigned mFlags // Zero or more SQLITE_DESERIALIZE_* flags
);
sqlite_int64 sqlite3_int64
SQLITE_API int sqlite3_deserialize(sqlite3 *db, const char *zSchema, unsigned char *pData, sqlite3_int64 szDb, sqlite3_int64 szBuf, unsigned mFlags)

Definition at line 601 of file Sq3LiteC_sq3.h.

607 {
608 SQ3_INSTANCE_RT_X(sq3lite);
609
610 Sq3LiteDeserializeHide_E(sq3lite, zSchema, (MK_BIN)pData.data, (MK_I64)pData.size, (MK_I64)pData.size, mFlags);
611 return MK_OK;
612error:
613 return MkErrorStack_1X(sq3lite);
614}
#define MkErrorStack_1X(...)
MK_BINB * MK_BIN
signed long long MK_I64
#define Sq3LiteDeserializeHide_E(...)
MK_SIZE size
MK_BINN data

◆ Sq3LiteDeserializeHide()

static enum MkErrorE Sq3LiteDeserializeHide ( SQ3_LITE db,
MK_STRN zSchema,
MK_BIN pData,
MK_I64 szDb,
MK_I64 szBuf,
enum Sq3DeSerializeEF mFlags )
inlinestatic

Deserialize a database …

The Sq3LiteDeserialize(D,S,P,N,M,F) interface causes the database connection D to disconnect from database S and then reopen S as an in-memory database based on the serialization contained in P. The serialized database P is N bytes in size. M is the size of the buffer P, which might be larger than N. If M is larger than N, and the SQ3_DESERIALIZE_READONLY bit is not set in F, then SQLite is permitted to add content to the in-memory database as long as the total size does not exceed M bytes.

If the SQ3_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will invoke Sq3Free() on the serialization buffer when the database connection closes. If the SQ3_DESERIALIZE_RESIZEABLE bit is set, then SQLite will try to increase the buffer size using Sq3Realloc64() if writes on the database cause it to grow larger than M bytes.

Applications must not modify the buffer P or invalidate it before the database connection D is closed.

The Sq3LiteDeserialize() interface will fail with SQ3_RESULT_BUSY if the database is currently in a read transaction or is involved in a backup operation.

It is not possible to deserialized into the TEMP database. If the S argument to Sq3LiteDeserialize(D,S,P,N,M,F) is "temp" then the function returns SQ3_RESULT_ERROR.

The deserialized database should not be in WAL mode. If the database is in WAL mode, then any attempt to use the database file will result in an SQ3_RESULT_CANTOPEN error. The application can set the file format version numbers (bytes 18 and 19) of the input database P to 0x01 prior to invoking Sq3LiteDeserialize(D,S,P,N,M,F) to force the database file into rollback mode and work around this limitation.

If Sq3LiteDeserialize(D,S,P,N,M,F) fails for any reason and if the SQ3_DESERIALIZE_FREEONCLOSE bit is set in argument F, then Sq3Free () is invoked on argument P prior to returning.

This interface is omitted if SQLite is compiled with the SQLITE_OMIT_DESERIALIZE option.

Reference code from sqlite3:

sqlite3 *db, // The database connection
const char *zSchema, // Which DB to reopen with the deserialization
unsigned char *pData, // The serialized database content
sqlite3_int64 szDb, // Number bytes in the deserialization
sqlite3_int64 szBuf, // Total size of buffer pData[]
unsigned mFlags // Zero or more SQLITE_DESERIALIZE_* flags
);

Definition at line 385 of file Sq3LiteC_sq3.h.

385 {
387 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_deserialize(db->nat, zSchema, pData, szDb, szBuf, mFlags);
388 Sq3ErrorE_Check(db, errVal);
389 return MK_OK;
390 error:
391 return MK_ERROR;
392 }

◆ Sq3LiteDeserializeHideP()

enum MkErrorE Sq3LiteDeserializeHideP ( SQ3_LITE db,
MK_STRN zSchema,
MK_BIN pData,
MK_I64 szDb,
MK_I64 szBuf,
enum Sq3DeSerializeEF mFlags )

Non-inline replacement for Sq3LiteDeserializeHide

◆ Sq3LiteDeserializeP()

enum MkErrorE Sq3LiteDeserializeP ( MK_RT mkrt,
SQ3_LITE sq3lite,
MK_STRN zSchema,
MkBinaryR pData,
enum Sq3DeSerializeEF mFlags )

Non-inline replacement for Sq3LiteDeserialize

◆ Sq3LiteDropModules_RT()

enum MkErrorE Sq3LiteDropModules_RT ( MK_RT mkrt,
SQ3_LITE sq3lite,
MK_BFL azKeepBfl )

Remove Unnecessary Virtual Table Implementations …

This is an enhanced version of Sq3LiteDropModulesHide.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sq3litethe Sq3LiteC instance to work on a database
azKeepBflThe MkBufferListC list of modules to drop
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

Sq3LiteDropModulesHide : documentation

Remove Unnecessary Virtual Table Implementations …
The Sq3LiteDropModules(D,L) interface removes all virtual table modules from database connection D except those named on list L. The L parameter must be either NULL or a pointer to an array of pointers to strings where the array is terminated by a single NULL pointer. If the L parameter is NULL, then all virtual table modules are removed.
Reference code from sqlite3:
sqlite3 *db, // Remove modules from this connection
const char **azKeep // Except, do not remove the ones named here
);
SQLITE_API int sqlite3_drop_modules(sqlite3 *db, const char **azKeep)

◆ Sq3LiteDropModulesHide()

static enum MkErrorE Sq3LiteDropModulesHide ( SQ3_LITE db,
MK_STRN * azKeep )
inlinestatic

Remove Unnecessary Virtual Table Implementations …

The Sq3LiteDropModules(D,L) interface removes all virtual table modules from database connection D except those named on list L. The L parameter must be either NULL or a pointer to an array of pointers to strings where the array is terminated by a single NULL pointer. If the L parameter is NULL, then all virtual table modules are removed.

See also: sqlite3_create_module ()

Reference code from sqlite3:

sqlite3 *db, // Remove modules from this connection
const char **azKeep // Except, do not remove the ones named here
);

Definition at line 395 of file Sq3LiteC_sq3.h.

395 {
397 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_drop_modules(db->nat, azKeep);
398 Sq3ErrorE_Check(db, errVal);
399 return MK_OK;
400 error:
401 return MK_ERROR;
402 }

◆ Sq3LiteDropModulesHideP()

enum MkErrorE Sq3LiteDropModulesHideP ( SQ3_LITE db,
MK_STRN * azKeep )

Non-inline replacement for Sq3LiteDropModulesHide

◆ Sq3LiteFileControl()

static enum MkErrorE Sq3LiteFileControl ( SQ3_LITE sq3lite,
MK_STRN zDbName,
enum Sq3TestCtrlE op,
MK_PTR arg3 )
inlinestatic

Low-Level Control Of Database Files …

The Sq3LiteFileControl () interface makes a direct call to the xFileControl method for the sqlite3_io_methods object associated with a particular database identified by the second argument. The name of the database is "main" for the main database or "temp" for the TEMP database, or the name that appears after the AS keyword for databases that are added using the ATTACH SQL command. A NULL pointer can be used in place of "main" to refer to the main database file. The third and fourth parameters to this routine are passed directly through to the second and third parameters of the xFileControl method. The return value of the xFileControl method becomes the return value of this routine.

A few opcodes for Sq3LiteFileControl () are handled directly by the SQLite core and never invoke the sqlite3_io_methods.xFileControl method. The SQ3_FCNTL_FILE_POINTER value for the op parameter causes a pointer to the underlying Sq3FileC object to be written into the space pointed to by the 4th parameter. The SQ3_FCNTL_JOURNAL_POINTER works similarly except that it returns the Sq3FileC object associated with the journal file instead of the main database. The SQ3_FCNTL_VFS_POINTER opcode returns a pointer to the underlying sqlite3_vfs object for the file. The SQ3_FCNTL_DATA_VERSION returns the data version counter from the pager.

If the second parameter (zDbName) does not match the name of any open database file, then SQ3_RESULT_ERROR is returned. This error code is not remembered and will not be recalled by Sq3LiteErrCode () or Sq3LiteErrMsg (). The underlying xFileControl method might also return SQ3_RESULT_ERROR. There is no way to distinguish between an incorrect zDbName and an SQ3_RESULT_ERROR return from the underlying xFileControl method.

See also: file control opcodes

Reference code from sqlite3:

SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
SQLITE_API int sqlite3_file_control(sqlite3 *, const char *zDbName, int op, void *)

Definition at line 405 of file Sq3LiteC_sq3.h.

405 {
406 SQ3_INSTANCE_HDL(sq3lite);
407 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_file_control(sq3lite->nat, zDbName, op, (MK_PTR)(arg3));
408 Sq3ErrorE_Check(sq3lite, errVal);
409 return MK_OK;
410 error:
411 return MK_ERROR;
412 }

◆ Sq3LiteFileControlP()

enum MkErrorE Sq3LiteFileControlP ( SQ3_LITE sq3lite,
MK_STRN zDbName,
enum Sq3TestCtrlE op,
MK_PTR arg3 )

Non-inline replacement for Sq3LiteFileControl

◆ Sq3LiteLog_RT()

void Sq3LiteLog_RT ( MK_RT mkrt,
SQ3_LITEN const lite,
MK_OBJN fmtobj,
MK_DBG const debug,
MK_STRN const callfunc,
MK_I32 const lvl )

log the lite

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]liteProgramming-Language-Micro-Kernel (PLMK) instance from libsqlite3
[in]fmtobjmanaged object used to format the log-message (default=null → use default-format)
[in]debugthe debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0)
[in]callfunca user-defined postfix to identify the calling function or the environment (default=name-of-function)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)

◆ Sq3LiteOverloadFunction()

static enum MkErrorE Sq3LiteOverloadFunction ( SQ3_LITE sq3lite,
MK_STRN zFuncName,
MK_I32 nArg )
inlinestatic

Overload A Function For A Virtual Table …

Virtual tables can provide alternative implementations of functions using the xFindFunction method of the virtual table module. But global versions of those functions must exist in order to be overloaded.

This API makes sure a global version of a function with a particular name and number of parameters exists. If no such function exists before this API is called, a new function is created. The implementation of the new function always causes an exception to be thrown. So the new function is not good for anything by itself. Its only purpose is to be a placeholder function that can be overloaded by a virtual table.

Reference code from sqlite3:

SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
SQLITE_API int sqlite3_overload_function(sqlite3 *, const char *zFuncName, int nArg)

Definition at line 415 of file Sq3LiteC_sq3.h.

415 {
416 SQ3_INSTANCE_HDL(sq3lite);
417 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_overload_function(sq3lite->nat, zFuncName, nArg);
418 Sq3ErrorE_Check(sq3lite, errVal);
419 return MK_OK;
420 error:
421 return MK_ERROR;
422 }
+ Here is the caller graph for this function:

◆ Sq3LiteOverloadFunctionP()

enum MkErrorE Sq3LiteOverloadFunctionP ( SQ3_LITE sq3lite,
MK_STRN zFuncName,
MK_I32 nArg )

Non-inline replacement for Sq3LiteOverloadFunction

◆ Sq3LiteSerialize()

static MkBinaryR Sq3LiteSerialize ( SQ3_LITE sq3lite,
MK_STRN zSchema,
enum Sq3SerializeE mFlags )
inlinestatic

Serialize a database …

This is an enhanced version of Sq3LiteSerializeHide, the return value changed to MkBinaryR.

Parameters
[in]sq3litethe Sq3LiteC instance to work on a database
[in]zSchemaWhich DB to serialize. ex: "main", "temp", ...
[in]mFlagsZero or more Sq3SerializeE flags
Returns
The data requested as MkBinaryR

Sq3LiteSerializeHide : documentation

Serialize a database …
The Sq3LiteSerialize(D,S,P,F) interface returns a pointer to memory that is a serialization of the S database on database connection D. If P is not a NULL pointer, then the size of the database in bytes is written into *P.
For an ordinary on-disk database file, the serialization is just a copy of the disk file. For an in-memory database or a "TEMP" database, the serialization is the same sequence of bytes which would be written to disk if that database where backed up to disk.
The usual case is that Sq3LiteSerialize() copies the serialization of the database into memory obtained from Sq3Malloc64 () and returns a pointer to that memory. The caller is responsible for freeing the returned value to avoid a memory leak. However, if the F argument contains the SQ3_SERIALIZE_NOCOPY bit, then no memory allocations are made, and the Sq3LiteSerialize() function will return a pointer to the contiguous memory representation of the database that SQLite is currently using for that database, or NULL if the no such contiguous memory representation of the database exists. A contiguous memory representation of the database will usually only exist if there has been a prior call to Sq3LiteDeserialize (D,S,...) with the same values of D and S. The size of the database is written into *P even if the SQ3_SERIALIZE_NOCOPY bit is set but no contiguous copy of the database exists.
After the call, if the SQ3_SERIALIZE_NOCOPY bit had been set, the returned buffer content will remain accessible and unchanged until either the next write operation on the connection or when the connection is closed, and applications must not modify the buffer. If the bit had been clear, the returned buffer will not be accessed by SQLite after the call.
A call to Sq3LiteSerialize(D,S,P,F) might return NULL even if the SQ3_SERIALIZE_NOCOPY bit is omitted from argument F if a memory allocation error occurs.
This interface is omitted if SQLite is compiled with the SQLITE_OMIT_DESERIALIZE option.
Reference code from sqlite3:
sqlite3 *db, // The database connection
const char *zSchema, // Which DB to serialize. ex: "main", "temp", ...
sqlite3_int64 *piSize, // Write size of the DB here, if not NULL
unsigned int mFlags // Zero or more SQLITE_SERIALIZE_* flags
);
SQLITE_API unsigned char * sqlite3_serialize(sqlite3 *db, const char *zSchema, sqlite3_int64 *piSize, unsigned int mFlags)

Definition at line 579 of file Sq3LiteC_sq3.h.

579 {
580 SQ3_INSTANCE_HDL(sq3lite);
581
582 MK_I64 piSize_val = 0;
583 MK_BIN __retVal__L = Sq3LiteSerializeHide(sq3lite, zSchema, &piSize_val, mFlags);
584 return MkBinaryCreate((MK_SIZE)piSize_val,__retVal__L);
585}
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
long MK_SIZE
+ Here is the caller graph for this function:

◆ Sq3LiteSerializeHide()

static MK_BIN Sq3LiteSerializeHide ( SQ3_LITE db,
MK_STRN zSchema,
MK_I64 * piSize,
enum Sq3SerializeE mFlags )
inlinestatic

Serialize a database …

The Sq3LiteSerialize(D,S,P,F) interface returns a pointer to memory that is a serialization of the S database on database connection D. If P is not a NULL pointer, then the size of the database in bytes is written into *P.

For an ordinary on-disk database file, the serialization is just a copy of the disk file. For an in-memory database or a "TEMP" database, the serialization is the same sequence of bytes which would be written to disk if that database where backed up to disk.

The usual case is that Sq3LiteSerialize() copies the serialization of the database into memory obtained from Sq3Malloc64 () and returns a pointer to that memory. The caller is responsible for freeing the returned value to avoid a memory leak. However, if the F argument contains the SQ3_SERIALIZE_NOCOPY bit, then no memory allocations are made, and the Sq3LiteSerialize() function will return a pointer to the contiguous memory representation of the database that SQLite is currently using for that database, or NULL if the no such contiguous memory representation of the database exists. A contiguous memory representation of the database will usually only exist if there has been a prior call to Sq3LiteDeserialize (D,S,...) with the same values of D and S. The size of the database is written into *P even if the SQ3_SERIALIZE_NOCOPY bit is set but no contiguous copy of the database exists.

After the call, if the SQ3_SERIALIZE_NOCOPY bit had been set, the returned buffer content will remain accessible and unchanged until either the next write operation on the connection or when the connection is closed, and applications must not modify the buffer. If the bit had been clear, the returned buffer will not be accessed by SQLite after the call.

A call to Sq3LiteSerialize(D,S,P,F) might return NULL even if the SQ3_SERIALIZE_NOCOPY bit is omitted from argument F if a memory allocation error occurs.

This interface is omitted if SQLite is compiled with the SQLITE_OMIT_DESERIALIZE option.

Reference code from sqlite3:

sqlite3 *db, // The database connection
const char *zSchema, // Which DB to serialize. ex: "main", "temp", ...
sqlite3_int64 *piSize, // Write size of the DB here, if not NULL
unsigned int mFlags // Zero or more SQLITE_SERIALIZE_* flags
);

Definition at line 437 of file Sq3LiteC_sq3.h.

437 {
439 return sqlite3_serialize(db->nat, zSchema, piSize, mFlags);
440 }
+ Here is the caller graph for this function:

◆ Sq3LiteSerializeHideP()

MK_BIN Sq3LiteSerializeHideP ( SQ3_LITE db,
MK_STRN zSchema,
MK_I64 * piSize,
enum Sq3SerializeE mFlags )

Non-inline replacement for Sq3LiteSerializeHide

◆ Sq3LiteSerializeP()

MkBinaryR Sq3LiteSerializeP ( SQ3_LITE sq3lite,
MK_STRN zSchema,
enum Sq3SerializeE mFlags )

Non-inline replacement for Sq3LiteSerialize

◆ Sq3LiteTableColumnMetadata()

static enum MkErrorE Sq3LiteTableColumnMetadata ( SQ3_LITE db,
MK_STRN zDbName,
MK_STRN zTableName,
MK_STRN zColumnName,
MK_STRN * pzDataType,
MK_STRN * pzCollSeq,
MK_I32 * pNotNull,
MK_I32 * pPrimaryKey,
MK_I32 * pAutoinc )
inlinestatic

Extract Metadata About A Column Of A Table …

The Sq3LiteTableColumnMetadata(X,D,T,C,....) routine returns information about column C of table T in database D on database connection X. The Sq3LiteTableColumnMetadata() interface returns SQ3_RESULT_OK and fills in the non-NULL pointers in the final five arguments with appropriate values if the specified column exists. The Sq3LiteTableColumnMetadata() interface returns SQ3_RESULT_ERROR if the specified column does not exist. If the column-name parameter to Sq3LiteTableColumnMetadata() is a NULL pointer, then this routine simply checks for the existence of the table and returns SQ3_RESULT_OK if the table exists and SQ3_RESULT_ERROR if it does not. If the table name parameter T in a call to Sq3LiteTableColumnMetadata(X,D,T,C,...) is NULL then the result is undefined behavior.

The column is identified by the second, third and fourth parameters to this function. The second parameter is either the name of the database (i.e. "main", "temp", or an attached database) containing the specified table or NULL. If it is NULL, then all attached databases are searched for the table using the same algorithm used by the database engine to resolve unqualified table references.

The third and fourth parameters to this function are the table and column name of the desired column, respectively.

Metadata is returned by writing to the memory locations passed as the 5th and subsequent parameters to this function. Any of these arguments may be NULL, in which case the corresponding element of metadata is omitted.

Parameter Output
Type

Description

5th const char* Data type
6th const char* Name of default collation sequence
7th int True if column has a NOT NULL constraint
8th int True if column is part of the PRIMARY KEY
9th int True if column is AUTOINCREMENT

The memory pointed to by the character pointers returned for the declaration type and collation sequence is valid until the next call to any SQLite API function.

If the specified table is actually a view, an error code is returned.

If the specified column is "rowid", "oid" or "_rowid_" and the table is not a WITHOUT ROWID table and an INTEGER PRIMARY KEY column has been explicitly declared, then the output parameters are set for the explicitly declared column. If there is no INTEGER PRIMARY KEY column, then the outputs for the rowid are set as follows:

data type: "INTEGER"
collation sequence: "BINARY"
not null: 0
primary key: 1
auto increment: 0

This function causes all database schemas to be read from disk and parsed, if that has not already been done, and returns an error if any errors are encountered while loading the schema.

Reference code from sqlite3:

sqlite3 *db, // Connection handle
const char *zDbName, // Database name or NULL
const char *zTableName, // Table name
const char *zColumnName, // Column name
char const **pzDataType, // OUTPUT: Declared data type
char const **pzCollSeq, // OUTPUT: Collation sequence name
int *pNotNull, // OUTPUT: True if NOT NULL constraint exists
int *pPrimaryKey, // OUTPUT: True if column part of PK
int *pAutoinc // OUTPUT: True if column is auto-increment
);
SQLITE_API int sqlite3_table_column_metadata(sqlite3 *db, const char *zDbName, const char *zTableName, const char *zColumnName, char const **pzDataType, char const **pzCollSeq, int *pNotNull, int *pPrimaryKey, int *pAutoinc)

Definition at line 443 of file Sq3LiteC_sq3.h.

443 {
445 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_table_column_metadata(db->nat, zDbName, zTableName, zColumnName, pzDataType, pzCollSeq, pNotNull, pPrimaryKey, pAutoinc);
446 Sq3ErrorE_Check(db, errVal);
447 return MK_OK;
448 error:
449 return MK_ERROR;
450 }
+ Here is the caller graph for this function:

◆ Sq3LiteTableColumnMetadataP()

enum MkErrorE Sq3LiteTableColumnMetadataP ( SQ3_LITE db,
MK_STRN zDbName,
MK_STRN zTableName,
MK_STRN zColumnName,
MK_STRN * pzDataType,
MK_STRN * pzCollSeq,
MK_I32 * pNotNull,
MK_I32 * pPrimaryKey,
MK_I32 * pAutoinc )

Non-inline replacement for Sq3LiteTableColumnMetadata

◆ Sq3LiteVtabConfig()

enum MkErrorE Sq3LiteVtabConfig ( SQ3_LITE sq3lite,
Sq3VtabE op,
... )

This function may be called by either the [xConnect] or [xCreate] method of a [virtual table] implementation to configure various facets of the virtual table interface.

If this interface is invoked outside the context of an xConnect or xCreate virtual table method then the behavior is undefined.

In the call sqlite3_vtab_config(D,C,...) the D parameter is the [database connection] in which the virtual table is being created and which is passed in as the first argument to the [xConnect] or [xCreate] method that is invoking sqlite3_vtab_config(). The C parameter is one of the [virtual table configuration options]. The presence and meaning of parameters after C depend on which [virtual table configuration option] is used.

Parameters
[in]sq3litethe Sq3LiteC instance to work on a database
[in]opconfiguration option to set
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)