49#ifndef PARSE_C_HEADER_TO_META
55 #define Sq3Fupu_Sq3LiteBusyHandler_arg1_ret MK_I32
56 #define Sq3Fupu_Sq3LiteBusyHandler_arg1_args MK_PTR arg0, MK_I32 arg1
62 #define Sq3Fupu_Sq3LiteCommitHook_arg1_ret MK_I32
63 #define Sq3Fupu_Sq3LiteCommitHook_arg1_args MK_PTR arg0
69 #define Sq3Fupu_Sq3LiteRollbackHook_arg1_ret void
70 #define Sq3Fupu_Sq3LiteRollbackHook_arg1_args MK_PTR arg0
76 #define Sq3Fupu_Sq3LiteUpdateHook_arg1_ret void
77 #define Sq3Fupu_Sq3LiteUpdateHook_arg1_args MK_PTR arg0, MK_I32 arg1, MK_STRN arg2, MK_STRN arg3, sqlite3_int64 arg4
82#ifndef PARSE_C_HEADER_TO_META
88 #define Sq3Fupu_Sq3LiteExec_callback_call_ret MK_I32
89 #define Sq3Fupu_Sq3LiteExec_callback_call_args MK_CBP callV1, MK_I32 num, MK_STR *vals, MK_STR *cols
94#ifndef PARSE_C_HEADER_TO_META
100 #define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret MK_U32
101 #define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args MK_PTR arg0, MK_STRN arg1, MK_U32 arg2, MK_U32 arg3, MK_U32 arg4
107 #define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret void
108 #define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args MK_PTR arg0
114 #define Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret MK_I32
115 #define Sq3Fupu_Sq3LiteCreateCollation_xCompare_args MK_PTR arg0, MK_I32 arg1, MK_PTRN arg2, MK_I32 arg3, MK_PTRN arg4
125#ifndef PARSE_C_HEADER_TO_META
152 return (
MK_PTR)sqlite3_commit_hook(sq3lite->
nat, arg1, (
MK_PTR)(arg2));
188 return (
MK_PTR)sqlite3_rollback_hook(sq3lite->
nat, arg1, (
MK_PTR)(arg2));
194 return (
MK_PTR)sqlite3_update_hook(sq3lite->
nat, arg1, (
MK_PTR)(arg2));
198#ifndef PARSE_C_HEADER_TO_META
211 MK_STRN __retVal__L = sqlite3_errmsg(sq3lite->
nat);
245 MK_STRN __retVal__L = sqlite3_errstr(arg0);
250#ifndef PARSE_C_HEADER_TO_META
257 enum Sq3ErrorE errVal = (
enum Sq3ErrorE)sqlite3_exec(sq3lite->
nat, sql, callback_call, callback_data, NULL);
276#ifndef PARSE_C_HEADER_TO_META
283 return sqlite3_get_autocommit(sq3lite->
nat);
289 return sqlite3_last_insert_rowid(sq3lite->
nat);
313#ifndef PARSE_C_HEADER_TO_META
350 SQ3_FILENAME __retVal__L = sqlite3_db_filename(db->
nat, zDbName);
357 MK_STRN __retVal__L = sqlite3_db_name(db->
nat, N);
384 enum Sq3ErrorE errVal = (
enum Sq3ErrorE)sqlite3_deserialize(db->
nat, zSchema, pData, szDb, szBuf, mFlags);
436 return sqlite3_serialize(db->
nat, zSchema, piSize, mFlags);
442 enum Sq3ErrorE errVal = (
enum Sq3ErrorE)sqlite3_table_column_metadata(db->
nat, zDbName, zTableName, zColumnName, pzDataType, pzCollSeq, pNotNull, pPrimaryKey, pAutoinc);
450#ifndef PARSE_C_HEADER_TO_META
469 enum Sq3ErrorE errVal = (
enum Sq3ErrorE)sqlite3_wal_checkpoint_v2(db->
nat, zDb, eMode, pnLog, pnCkpt);
477#ifndef PARSE_C_HEADER_TO_META
484 sqlite3_interrupt(sq3lite->
nat);
490 return (
MK_BOOL)sqlite3_is_interrupted(sq3lite->
nat);
494#ifndef PARSE_C_HEADER_TO_META
501 return sqlite3_changes(sq3lite->
nat);
507 return sqlite3_changes64(sq3lite->
nat);
513 sqlite3_set_last_insert_rowid(sq3lite->
nat, arg1);
519 return sqlite3_total_changes(sq3lite->
nat);
525 return sqlite3_total_changes64(sq3lite->
nat);
529#ifndef PARSE_C_HEADER_TO_META
536 sqlite3* ppDb_val = NULL;
537 if (MK_NULL_STR_CHECK_1(zVfs)) zVfs = NULL;
538 enum Sq3ErrorE errVal = (
enum Sq3ErrorE)sqlite3_open_v2(filename, &ppDb_val, flags, zVfs);
539 *ppDb = Sq3LiteC_ObjCreate(ppDb_val);
581 return MkBinaryCreate((
MK_SIZE)piSize_val,__retVal__L);
632#define Sq3LiteVtabConfig(sq3lite, op, ...) ({ \
633 Sq3ErrorE errVal = sqlite3_vtab_config(sq3lite->nat, op, __VA_ARGS__); \
634 Sq3ErrorE_Check_Macro(sq3lite,errVal); \
635 if (unlikely(Sq3ErrorCheckI(errVal))) { \
636 Sq3LiteErrorToMQ(MkOBJ(sq3lite), __func__,__FILE__,__LINE__); \
662 assert(val_out != NULL);
672 MkErrorReturnLabel(sq3lite);
715 MkErrorE_Check(Sq3StmtPrepareV2Hide(db,zSql.
ptr,zSql.
len,ppStmt,&pzTail));
716 (*ppStmt)->pzTail = pzTail;
717 MkErrorReturnLabel(db);
725#define Sq3Fupu_Sq3LiteExec_callback_call_check do { \
726 assert(callV1 != NULL); \
729#define Sq3Fupu_Sq3LiteExecV2CB_callback_call_check do { \
730 assert(callV2 != NULL); \
734#define Sq3LiteExecV2CB_ret enum MkErrorE
735#define Sq3LiteExecV2CB_args MK_RT_ARGS MK_CBP callV2, MK_BFL vals, MK_BFL cols
743typedef enum MkErrorE (*Sq3LiteExecV2CB) (
MK_RT_ARGS MK_CBP callV2, MK_BFL vals, MK_BFL cols);
759__parser__(
class=Sq3LiteC,doc-group=Execution,callback-name=LiteExecV2,callback-null,callback-once)
764 Sq3LiteExecV2CB callback_call
__parser__(callback-call),
#define BEGIN_SQ3_C_DECLS
#define Sq3LiteVtabConfig(sq3lite, op,...)
#define MkBufferListAppendI32(...)
#define MkBufferListCreateTLS_T(name, num)
#define MkErrorStack_1X(...)
#define MK_ATTR_RT_INSTANCE
__thread MK_TYP Sq3LiteC_TT
class as MkTypeDefS-class-type …
static MK_PTR Sq3LiteUpdateHook(SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteUpdateHook_arg1 arg1, MK_PTR arg2)
Data Change Notification Callbacks …
static MK_PTR Sq3LiteRollbackHook(SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteRollbackHook_arg1 arg1, MK_PTR arg2)
Commit And Rollback Notification Callbacks …
#define Sq3Fupu_Sq3LiteCommitHook_arg1_args
#define Sq3Fupu_Sq3LiteUpdateHook_arg1_ret
static enum MkErrorE Sq3LiteBusyTimeout(SQ3_LITE sq3lite, MK_I32 ms)
Set A Busy Timeout …
#define Sq3Fupu_Sq3LiteCommitHook_arg1_ret
static enum MkErrorE Sq3LiteLimit(SQ3_LITE sq3lite, enum Sq3LimitE id, MK_I32 newVal)
Run-time Limits …
#define Sq3Fupu_Sq3LiteBusyHandler_arg1_args
static enum MkErrorE Sq3LiteDeclareVtab(SQ3_LITE sq3lite, MK_STRN zSQL)
Declare The Schema Of A Virtual Table …
static enum MkErrorE Sq3LiteExtendedResultCodes(SQ3_LITE sq3lite, MK_I32 onoff)
Enable Or Disable Extended Result Codes …
#define Sq3Fupu_Sq3LiteRollbackHook_arg1_args
static enum MkErrorE Sq3LiteBusyHandler(SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1, MK_PTR arg2)
Register A Callback To Handle SQLITE_BUSY Errors …
#define Sq3Fupu_Sq3LiteBusyHandler_arg1_ret
static MK_PTR Sq3LiteCommitHook(SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteCommitHook_arg1 arg1, MK_PTR arg2)
Commit And Rollback Notification Callbacks …
#define Sq3Fupu_Sq3LiteUpdateHook_arg1_args
#define Sq3Fupu_Sq3LiteRollbackHook_arg1_ret
static MK_STRN Sq3LiteErrStr(MK_I32 arg0)
Error Codes And Messages …
static enum Sq3ErrorE Sq3LiteErrCode(SQ3_LITE db)
Error Codes And Messages …
static enum MkErrorE Sq3LiteSystemErrno(SQ3_LITE sq3lite)
Low-level system error code …
static enum MkErrorE Sq3LiteErrorOffset(SQ3_LITE db)
Error Codes And Messages …
static enum Sq3ExtendetResultCodesE Sq3LiteExtendetErrCode(SQ3_LITE db)
Error Codes And Messages …
static MK_STRN Sq3LiteErrMsg(SQ3_LITE sq3lite)
Error Codes And Messages …
static enum MkErrorE Sq3LiteExec(SQ3_LITE sq3lite, MK_STRN sql, Sq3Fupu_Sq3LiteExec_callback_call callback_call, MK_CBP callback_data)
One-Step Query Execution Interface …
static enum MkErrorE Sq3LiteSleep(MK_I32 arg0)
Suspend Execution For A Short Time …
#define Sq3Fupu_Sq3LiteExec_callback_call_args
#define Sq3Fupu_Sq3LiteExec_callback_call_ret
static MK_I32 Sq3LiteGetAutocommit(SQ3_LITE sq3lite)
Test For Auto-Commit Mode …
static MK_I64 Sq3LiteLastInsertRowid(SQ3_LITE sq3lite)
Last Insert Rowid …
static enum MkErrorE Sq3LiteTxnState(SQ3_LITE sq3lite, MK_STRN zSchema)
Determine the transaction state of a database …
static enum MkErrorE Sq3LiteVtabOnConflict(SQ3_LITE sq3lite)
Determine The Virtual Table Conflict Policy …
#define Sq3LiteDbStatus_E(...)
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_args
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_args
static enum MkErrorE Sq3LiteOverloadFunction(SQ3_LITE sq3lite, MK_STRN zFuncName, MK_I32 nArg)
Overload A Function For A Virtual Table …
static MK_BIN Sq3LiteSerializeHide(SQ3_LITE db, MK_STRN zSchema, MK_I64 *piSize, enum Sq3SerializeE mFlags)
Serialize a database …
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg3_ret
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 enum MkErrorE Sq3LiteDbReadonly(SQ3_LITE db, MK_STRN zDbName)
Determine if a database is read-only …
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 Sq3LiteAutovacuumPages(SQ3_LITE db, Sq3Fupu_Sq3LiteAutovacuumPages_arg1 arg1, MK_PTR arg2, Sq3Fupu_Sq3LiteAutovacuumPages_arg3 arg3)
Autovacuum Compaction Amount Callback …
static enum MkErrorE Sq3LiteDbStatus(SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_I32 *pCur, MK_I32 *pHiwtr, MK_BOOL resetFlg)
Database Connection Status …
#define Sq3LiteDeserializeHide_E(...)
static enum MkErrorE Sq3LiteDbCacheflush(SQ3_LITE sq3lite)
Flush caches to disk mid-transaction …
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 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 Sq3LiteDbStatusBFL_RT(MK_RT mkrt, SQ3_LITE sq3lite, enum Sq3DbStatusE op, MK_BFL *val_out, MK_BOOL resetFlg)
Database Connection Status …
static enum MkErrorE Sq3LiteDropModulesHide(SQ3_LITE db, MK_STRN *azKeep)
Remove Unnecessary Virtual Table Implementations …
#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_ret
#define Sq3Fupu_Sq3LiteAutovacuumPages_arg1_ret
static MkBinaryR Sq3LiteSerialize(SQ3_LITE sq3lite, MK_STRN zSchema, enum Sq3SerializeE mFlags)
Serialize a database …
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 Sq3LiteDeserialize_RT(MK_RT mkrt, SQ3_LITE sq3lite, MK_STRN zSchema, MkBinaryR pData, enum Sq3DeSerializeEF mFlags)
Deserialize a database …
#define Sq3Fupu_Sq3LiteCreateCollation_xCompare_args
enum MkErrorE Sq3LiteDropModules_RT(MK_RT mkrt, SQ3_LITE sq3lite, MK_BFL azKeepBfl)
Remove Unnecessary Virtual Table Implementations …
static enum MkErrorE Sq3LiteDbReleaseMemory(SQ3_LITE sq3lite)
Free Memory Used By A Database Connection …
static enum MkErrorE Sq3LiteWalAutocheckpoint(SQ3_LITE db, MK_I32 N)
Configure an auto-checkpoint …
static enum MkErrorE Sq3LiteWalCheckpointV2(SQ3_LITE db, MK_STRN zDb, MK_I32 eMode, MK_I32 *pnLog, MK_I32 *pnCkpt)
Checkpoint a database …
static void Sq3LiteInterrupt(SQ3_LITE sq3lite)
Interrupt A Long-Running Query …
static MK_BOOL Sq3LiteIsInterrupted(SQ3_LITE sq3lite)
Interrupt A Long-Running Query …
static MK_I64 Sq3LiteChanges64(SQ3_LITE sq3lite)
Count The Number Of Rows Modified …
static MK_I64 Sq3LiteTotalChanges64(SQ3_LITE sq3lite)
Total Number Of Rows Modified …
static MK_I32 Sq3LiteTotalChanges(SQ3_LITE sq3lite)
Total Number Of Rows Modified …
static void Sq3LiteSetLastInsertRowid(SQ3_LITE sq3lite, MK_I64 arg1)
Set the Last Insert Rowid value …
static MK_I32 Sq3LiteChanges(SQ3_LITE sq3lite)
Count The Number Of Rows Modified …
static enum MkErrorE Sq3LiteCloseV2(SQ3_LITE sq3lite)
Closing A Database Connection …
static enum MkErrorE Sq3LiteOpenV2(MK_STRN filename, SQ3_LITE *ppDb, enum Sq3OpenEF flags, MK_STRN zVfs)
Opening A New Database Connection …
#define SQ3_EXTERN
static library
Sq3VtabE
Virtual Table Configuration Options.
Sq3DbStatusE
Status Parameters for database connections.
Sq3DeSerializeEF
Flags for sqlite3_deserialize()
Sq3LimitE
Run-Time Limit Categories.
Sq3OpenEF
Flags For File Open Operations.
Sq3ExtendetResultCodesE
Extended Result Codes.
Sq3SerializeE
Flags for sqlite3_serialize.
Sq3TestCtrlE
Testing Interface Operation Codes.
#define Sq3ErrorE_Check_Static(cls_hdl, PROC)
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a ccsq3lite error and convert into a ccsq3lite error …
#define SQ3_INSTANCE_HDL(x)
#define SQ3_INSTANCE_RT_X(x)
static enum MkErrorE Sq3LitePrepareV2(SQ3_LITE db, MkStringR zSql, SQ3_STMT *ppStmt)
Compiling An SQL Statement …
Struct to represent the data of the Sq3LiteC …
sqlite3 * nat
internal - link between Sq3LiteS and native library
Struct to represent the data of the Sq3StmtC …