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_Config_C_API

Sq3LiteC - configure the classMore...

+ Collaboration diagram for Sq3LiteC_Config_C_API:

Macros

#define Sq3Fupu_Sq3LiteBusyHandler_arg1_ret   MK_I32
 
#define Sq3Fupu_Sq3LiteBusyHandler_arg1_args   MK_PTR arg0, MK_I32 arg1
 
#define Sq3Fupu_Sq3LiteCommitHook_arg1_ret   MK_I32
 
#define Sq3Fupu_Sq3LiteCommitHook_arg1_args   MK_PTR arg0
 
#define Sq3Fupu_Sq3LiteRollbackHook_arg1_ret   void
 
#define Sq3Fupu_Sq3LiteRollbackHook_arg1_args   MK_PTR arg0
 
#define Sq3Fupu_Sq3LiteUpdateHook_arg1_ret   void
 
#define Sq3Fupu_Sq3LiteUpdateHook_arg1_args   MK_PTR arg0, MK_I32 arg1, MK_STRN arg2, MK_STRN arg3, sqlite3_int64 arg4
 

Typedefs

typedef Sq3Fupu_Sq3LiteBusyHandler_arg1_ret(* Sq3Fupu_Sq3LiteBusyHandler_arg1) (Sq3Fupu_Sq3LiteBusyHandler_arg1_args)
 
typedef Sq3Fupu_Sq3LiteCommitHook_arg1_ret(* Sq3Fupu_Sq3LiteCommitHook_arg1) (Sq3Fupu_Sq3LiteCommitHook_arg1_args)
 
typedef Sq3Fupu_Sq3LiteRollbackHook_arg1_ret(* Sq3Fupu_Sq3LiteRollbackHook_arg1) (Sq3Fupu_Sq3LiteRollbackHook_arg1_args)
 
typedef Sq3Fupu_Sq3LiteUpdateHook_arg1_ret(* Sq3Fupu_Sq3LiteUpdateHook_arg1) (Sq3Fupu_Sq3LiteUpdateHook_arg1_args)
 

Functions

static enum MkErrorE Sq3LiteBusyHandler (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1, MK_PTR arg2)
 Register A Callback To Handle SQLITE_BUSY Errors …
 
static enum MkErrorE Sq3LiteBusyTimeout (SQ3_LITE sq3lite, MK_I32 ms)
 Set A Busy Timeout …
 
static MK_PTR Sq3LiteCommitHook (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteCommitHook_arg1 arg1, MK_PTR arg2)
 Commit And Rollback Notification Callbacks …
 
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 …
 
static enum MkErrorE Sq3LiteLimit (SQ3_LITE sq3lite, enum Sq3LimitE id, MK_I32 newVal)
 Run-time Limits …
 
static MK_PTR Sq3LiteRollbackHook (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteRollbackHook_arg1 arg1, MK_PTR arg2)
 Commit And Rollback Notification Callbacks …
 
static MK_PTR Sq3LiteUpdateHook (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteUpdateHook_arg1 arg1, MK_PTR arg2)
 Data Change Notification Callbacks …
 

Sq3LiteC - Sq3LiteC_Config_C_API - function

enum MkErrorE Sq3LiteBusyHandlerP (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1, MK_PTR arg2)
 Non-inline replacement for Sq3LiteBusyHandler
 
enum MkErrorE Sq3LiteBusyTimeoutP (SQ3_LITE sq3lite, MK_I32 ms)
 Non-inline replacement for Sq3LiteBusyTimeout
 
MK_PTR Sq3LiteCommitHookP (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteCommitHook_arg1 arg1, MK_PTR arg2)
 Non-inline replacement for Sq3LiteCommitHook
 
enum MkErrorE Sq3LiteDeclareVtabP (SQ3_LITE sq3lite, MK_STRN zSQL)
 Non-inline replacement for Sq3LiteDeclareVtab
 
enum MkErrorE Sq3LiteExtendedResultCodesP (SQ3_LITE sq3lite, MK_I32 onoff)
 Non-inline replacement for Sq3LiteExtendedResultCodes
 
enum MkErrorE Sq3LiteLimitP (SQ3_LITE sq3lite, enum Sq3LimitE id, MK_I32 newVal)
 Non-inline replacement for Sq3LiteLimit
 
MK_PTR Sq3LiteRollbackHookP (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteRollbackHook_arg1 arg1, MK_PTR arg2)
 Non-inline replacement for Sq3LiteRollbackHook
 
MK_PTR Sq3LiteUpdateHookP (SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteUpdateHook_arg1 arg1, MK_PTR arg2)
 Non-inline replacement for Sq3LiteUpdateHook
 

Sq3LiteC - Sq3LiteC_Config_C_API - overload

#define Sq3LiteBusyHandler_E(...)
 
#define Sq3LiteBusyHandler_C(...)
 
#define Sq3LiteBusyTimeout_E(...)
 
#define Sq3LiteBusyTimeout_C(...)
 
#define Sq3LiteDeclareVtab_E(...)
 
#define Sq3LiteDeclareVtab_C(...)
 
#define Sq3LiteExtendedResultCodes_E(...)
 
#define Sq3LiteExtendedResultCodes_C(...)
 
#define Sq3LiteLimit_E(...)
 
#define Sq3LiteLimit_C(...)
 

Detailed Description

Sq3LiteC - configure the class

Macro Definition Documentation

◆ Sq3Fupu_Sq3LiteBusyHandler_arg1_args

#define Sq3Fupu_Sq3LiteBusyHandler_arg1_args   MK_PTR arg0, MK_I32 arg1

Definition at line 59 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteBusyHandler_arg1_ret

#define Sq3Fupu_Sq3LiteBusyHandler_arg1_ret   MK_I32

Definition at line 58 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCommitHook_arg1_args

#define Sq3Fupu_Sq3LiteCommitHook_arg1_args   MK_PTR arg0

Definition at line 66 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCommitHook_arg1_ret

#define Sq3Fupu_Sq3LiteCommitHook_arg1_ret   MK_I32

Definition at line 65 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteRollbackHook_arg1_args

#define Sq3Fupu_Sq3LiteRollbackHook_arg1_args   MK_PTR arg0

Definition at line 73 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteRollbackHook_arg1_ret

#define Sq3Fupu_Sq3LiteRollbackHook_arg1_ret   void

Definition at line 72 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteUpdateHook_arg1_args

#define Sq3Fupu_Sq3LiteUpdateHook_arg1_args   MK_PTR arg0, MK_I32 arg1, MK_STRN arg2, MK_STRN arg3, sqlite3_int64 arg4

Definition at line 80 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteUpdateHook_arg1_ret

#define Sq3Fupu_Sq3LiteUpdateHook_arg1_ret   void

Definition at line 79 of file Sq3LiteC_sq3.h.

◆ Sq3LiteBusyHandler_C

#define Sq3LiteBusyHandler_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteBusyHandler(__VA_ARGS__)))
static enum MkErrorE Sq3LiteBusyHandler(SQ3_LITE sq3lite, Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1, MK_PTR arg2)
Register A Callback To Handle SQLITE_BUSY Errors …

Definition at line 362 of file sqlite3_overload_sq3.h.

◆ Sq3LiteBusyHandler_E

#define Sq3LiteBusyHandler_E ( ...)
Value:
MkErrorCheck(Sq3LiteBusyHandler(__VA_ARGS__))

Definition at line 361 of file sqlite3_overload_sq3.h.

◆ Sq3LiteBusyTimeout_C

#define Sq3LiteBusyTimeout_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteBusyTimeout(__VA_ARGS__)))
static enum MkErrorE Sq3LiteBusyTimeout(SQ3_LITE sq3lite, MK_I32 ms)
Set A Busy Timeout …

Definition at line 364 of file sqlite3_overload_sq3.h.

◆ Sq3LiteBusyTimeout_E

#define Sq3LiteBusyTimeout_E ( ...)
Value:
MkErrorCheck(Sq3LiteBusyTimeout(__VA_ARGS__))

Definition at line 363 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeclareVtab_C

#define Sq3LiteDeclareVtab_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteDeclareVtab(__VA_ARGS__)))
static enum MkErrorE Sq3LiteDeclareVtab(SQ3_LITE sq3lite, MK_STRN zSQL)
Declare The Schema Of A Virtual Table …

Definition at line 366 of file sqlite3_overload_sq3.h.

◆ Sq3LiteDeclareVtab_E

#define Sq3LiteDeclareVtab_E ( ...)
Value:
MkErrorCheck(Sq3LiteDeclareVtab(__VA_ARGS__))

Definition at line 365 of file sqlite3_overload_sq3.h.

◆ Sq3LiteExtendedResultCodes_C

#define Sq3LiteExtendedResultCodes_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteExtendedResultCodes(__VA_ARGS__)))
static enum MkErrorE Sq3LiteExtendedResultCodes(SQ3_LITE sq3lite, MK_I32 onoff)
Enable Or Disable Extended Result Codes …

Definition at line 368 of file sqlite3_overload_sq3.h.

◆ Sq3LiteExtendedResultCodes_E

#define Sq3LiteExtendedResultCodes_E ( ...)
Value:
MkErrorCheck(Sq3LiteExtendedResultCodes(__VA_ARGS__))

Definition at line 367 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLimit_C

#define Sq3LiteLimit_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteLimit(__VA_ARGS__)))
static enum MkErrorE Sq3LiteLimit(SQ3_LITE sq3lite, enum Sq3LimitE id, MK_I32 newVal)
Run-time Limits …

Definition at line 370 of file sqlite3_overload_sq3.h.

◆ Sq3LiteLimit_E

#define Sq3LiteLimit_E ( ...)
Value:
MkErrorCheck(Sq3LiteLimit(__VA_ARGS__))

Definition at line 369 of file sqlite3_overload_sq3.h.

Typedef Documentation

◆ Sq3Fupu_Sq3LiteBusyHandler_arg1

typedef Sq3Fupu_Sq3LiteBusyHandler_arg1_ret(* Sq3Fupu_Sq3LiteBusyHandler_arg1) (Sq3Fupu_Sq3LiteBusyHandler_arg1_args)

Definition at line 60 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteCommitHook_arg1

typedef Sq3Fupu_Sq3LiteCommitHook_arg1_ret(* Sq3Fupu_Sq3LiteCommitHook_arg1) (Sq3Fupu_Sq3LiteCommitHook_arg1_args)

Definition at line 67 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteRollbackHook_arg1

typedef Sq3Fupu_Sq3LiteRollbackHook_arg1_ret(* Sq3Fupu_Sq3LiteRollbackHook_arg1) (Sq3Fupu_Sq3LiteRollbackHook_arg1_args)

Definition at line 74 of file Sq3LiteC_sq3.h.

◆ Sq3Fupu_Sq3LiteUpdateHook_arg1

typedef Sq3Fupu_Sq3LiteUpdateHook_arg1_ret(* Sq3Fupu_Sq3LiteUpdateHook_arg1) (Sq3Fupu_Sq3LiteUpdateHook_arg1_args)

Definition at line 81 of file Sq3LiteC_sq3.h.

Function Documentation

◆ Sq3LiteBusyHandler()

static enum MkErrorE Sq3LiteBusyHandler ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1,
MK_PTR arg2 )
inlinestatic

Register A Callback To Handle SQLITE_BUSY Errors …

The Sq3LiteBusyHandler(D,X,P) routine sets a callback function X that might be invoked with argument P whenever an attempt is made to access a database table associated with database connection D when another thread or process has the table locked. The Sq3LiteBusyHandler() interface is used to implement Sq3LiteBusyTimeout () and PRAGMA busy_timeout.

If the busy callback is NULL, then SQ3_RESULT_BUSY is returned immediately upon encountering the lock. If the busy callback is not NULL, then the callback might be invoked with two arguments.

The first argument to the busy handler is a copy of the void* pointer which is the third argument to Sq3LiteBusyHandler(). The second argument to the busy handler callback is the number of times that the busy handler has been invoked previously for the same locking event. If the busy callback returns 0, then no additional attempts are made to access the database and SQ3_RESULT_BUSY is returned to the application. If the callback returns non-zero, then another attempt is made to access the database and the cycle repeats.

The presence of a busy handler does not guarantee that it will be invoked when there is lock contention. If SQLite determines that invoking the busy handler could result in a deadlock, it will go ahead and return SQ3_RESULT_BUSY to the application instead of invoking the busy handler. Consider a scenario where one process is holding a read lock that it is trying to promote to a reserved lock and a second process is holding a reserved lock that it is trying to promote to an exclusive lock. The first process cannot proceed because it is blocked by the second and the second process cannot proceed because it is blocked by the first. If both processes invoke the busy handlers, neither will make any progress. Therefore, SQLite returns SQ3_RESULT_BUSY for the first process, hoping that this will induce the first process to release its read lock and allow the second process to proceed.

The default busy callback is NULL.

There can only be a single busy handler defined for each database connection. Setting a new busy handler clears any previously set handler. Note that calling Sq3LiteBusyTimeout () or evaluating PRAGMA busy_timeout=N will change the busy handler and thus clear any previously set busy handler.

The busy callback should not take any actions which modify the database connection that invoked the busy handler. In other words, the busy handler is not reentrant. Any such actions result in undefined behavior.

A busy handler must not close the database connection or prepared statement that invoked the busy handler.

Reference code from sqlite3:

SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
struct sqlite3 sqlite3
#define SQLITE_API
SQLITE_API int sqlite3_busy_handler(sqlite3 *, int(*)(void *, int), void *)

Definition at line 133 of file Sq3LiteC_sq3.h.

133 {
134 SQ3_INSTANCE_HDL(sq3lite);
135 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_busy_handler(sq3lite->nat, arg1, (MK_PTR)(arg2));
136 Sq3ErrorE_Check(sq3lite, errVal);
137 return MK_OK;
138 error:
139 return MK_ERROR;
140 }
MK_ERROR
MK_OK
MK_PTRB * MK_PTR
Sq3ErrorE
Result Codes.
#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

◆ Sq3LiteBusyHandlerP()

enum MkErrorE Sq3LiteBusyHandlerP ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteBusyHandler_arg1 arg1,
MK_PTR arg2 )

Non-inline replacement for Sq3LiteBusyHandler

◆ Sq3LiteBusyTimeout()

static enum MkErrorE Sq3LiteBusyTimeout ( SQ3_LITE sq3lite,
MK_I32 ms )
inlinestatic

Set A Busy Timeout …

This routine sets a busy handler that sleeps for a specified amount of time when a table is locked. The handler will sleep multiple times until at least "ms" milliseconds of sleeping have accumulated. After at least "ms" milliseconds of sleeping, the handler returns 0 which causes Sq3StmtStep () to return SQ3_RESULT_BUSY.

Calling this routine with an argument less than or equal to zero turns off all busy handlers.

There can only be a single busy handler for a particular database connection at any given moment. If another busy handler was defined (using Sq3LiteBusyHandler ()) prior to calling this routine, that other busy handler is cleared.

See also: PRAGMA busy_timeout

Reference code from sqlite3:

SQLITE_API int sqlite3_busy_timeout(sqlite3 *, int ms)

Definition at line 143 of file Sq3LiteC_sq3.h.

143 {
144 SQ3_INSTANCE_HDL(sq3lite);
145 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_busy_timeout(sq3lite->nat, ms);
146 Sq3ErrorE_Check(sq3lite, errVal);
147 return MK_OK;
148 error:
149 return MK_ERROR;
150 }
+ Here is the caller graph for this function:

◆ Sq3LiteBusyTimeoutP()

enum MkErrorE Sq3LiteBusyTimeoutP ( SQ3_LITE sq3lite,
MK_I32 ms )

Non-inline replacement for Sq3LiteBusyTimeout

◆ Sq3LiteCommitHook()

static MK_PTR Sq3LiteCommitHook ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteCommitHook_arg1 arg1,
MK_PTR arg2 )
inlinestatic

Commit And Rollback Notification Callbacks …

The Sq3LiteCommitHook() interface registers a callback function to be invoked whenever a transaction is committed. Any callback set by a previous call to Sq3LiteCommitHook() for the same database connection is overridden. The Sq3LiteRollbackHook() interface registers a callback function to be invoked whenever a transaction is rolled back. Any callback set by a previous call to Sq3LiteRollbackHook() for the same database connection is overridden. The pArg argument is passed through to the callback. If the callback on a commit hook function returns non-zero, then the commit is converted into a rollback.

The Sq3LiteCommitHook(D,C,P) and Sq3LiteRollbackHook(D,C,P) functions return the P argument from the previous call of the same function on the same database connection D, or NULL for the first call for each function on D.

The commit and rollback hook callbacks are not reentrant. The callback implementation must not do anything that will modify the database connection that invoked the callback. Any actions to modify the database connection must be deferred until after the completion of the Sq3StmtStep () call that triggered the commit or rollback hook in the first place. Note that running any other SQL statements, including SELECT statements, or merely calling Sq3StmtPrepareV2 () and Sq3StmtStep () will modify the database connections for the meaning of "modify" in this paragraph.

Registering a NULL function disables the callback.

When the commit hook callback routine returns zero, the COMMIT operation is allowed to continue normally. If the commit hook returns non-zero, then the COMMIT is converted into a ROLLBACK. The rollback hook is invoked on a rollback that results from a commit hook returning non-zero, just as it would be with any other rollback.

For the purposes of this API, a transaction is said to have been rolled back if an explicit "ROLLBACK" statement is executed, or an error or constraint causes an implicit rollback to occur. The rollback callback is not invoked if a transaction is automatically rolled back because the database connection is closed.

See also the Sq3LiteUpdateHook () interface.

Reference code from sqlite3:

SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
SQLITE_API void * sqlite3_commit_hook(sqlite3 *, int(*)(void *), void *)
SQLITE_API void * sqlite3_rollback_hook(sqlite3 *, void(*)(void *), void *)

Definition at line 153 of file Sq3LiteC_sq3.h.

153 {
154 SQ3_INSTANCE_HDL(sq3lite);
155 return (MK_PTR)sqlite3_commit_hook(sq3lite->nat, arg1, (MK_PTR)(arg2));
156 }

◆ Sq3LiteCommitHookP()

MK_PTR Sq3LiteCommitHookP ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteCommitHook_arg1 arg1,
MK_PTR arg2 )

Non-inline replacement for Sq3LiteCommitHook

◆ Sq3LiteDeclareVtab()

static enum MkErrorE Sq3LiteDeclareVtab ( SQ3_LITE sq3lite,
MK_STRN zSQL )
inlinestatic

Declare The Schema Of A Virtual Table …

The xCreate and xConnect methods of a virtual table module call this interface to declare the format (the names and datatypes of the columns) of the virtual tables they implement.

Reference code from sqlite3:

SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
SQLITE_API int sqlite3_declare_vtab(sqlite3 *, const char *zSQL)

Definition at line 159 of file Sq3LiteC_sq3.h.

159 {
160 SQ3_INSTANCE_HDL(sq3lite);
161 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_declare_vtab(sq3lite->nat, zSQL);
162 Sq3ErrorE_Check(sq3lite, errVal);
163 return MK_OK;
164 error:
165 return MK_ERROR;
166 }
+ Here is the caller graph for this function:

◆ Sq3LiteDeclareVtabP()

enum MkErrorE Sq3LiteDeclareVtabP ( SQ3_LITE sq3lite,
MK_STRN zSQL )

Non-inline replacement for Sq3LiteDeclareVtab

◆ Sq3LiteExtendedResultCodes()

static enum MkErrorE Sq3LiteExtendedResultCodes ( SQ3_LITE sq3lite,
MK_I32 onoff )
inlinestatic

Enable Or Disable Extended Result Codes …

The Sq3LiteExtendedResultCodes() routine enables or disables the extended result codes feature of SQLite. The extended result codes are disabled by default for historical compatibility.

Reference code from sqlite3:

SQLITE_API int sqlite3_extended_result_codes(sqlite3 *, int onoff)

Definition at line 169 of file Sq3LiteC_sq3.h.

169 {
170 SQ3_INSTANCE_HDL(sq3lite);
171 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_extended_result_codes(sq3lite->nat, onoff);
172 Sq3ErrorE_Check(sq3lite, errVal);
173 return MK_OK;
174 error:
175 return MK_ERROR;
176 }
+ Here is the caller graph for this function:

◆ Sq3LiteExtendedResultCodesP()

enum MkErrorE Sq3LiteExtendedResultCodesP ( SQ3_LITE sq3lite,
MK_I32 onoff )

Non-inline replacement for Sq3LiteExtendedResultCodes

◆ Sq3LiteLimit()

static enum MkErrorE Sq3LiteLimit ( SQ3_LITE sq3lite,
enum Sq3LimitE id,
MK_I32 newVal )
inlinestatic

Run-time Limits …

This interface allows the size of various constructs to be limited on a connection by connection basis. The first parameter is the database connection whose limit is to be set or queried. The second parameter is one of the limit categories that define a class of constructs to be size limited. The third parameter is the new limit for that construct.

If the new limit is a negative number, the limit is unchanged. For each limit category SQ3_LIMIT_NAME there is a hard upper bound set at compile-time by a C preprocessor macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to "_MAX_".) Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound.

Regardless of whether or not the limit was changed, the Sq3LiteLimit () interface returns the prior value of the limit. Hence, to find the current value of a limit without changing it, simply invoke this interface with the third parameter set to -1.

Run-time limits are intended for use in applications that manage both their own internal database and also databases that are controlled by untrusted external sources. An example application might be a web browser that has its own databases for storing history and separate databases controlled by JavaScript applications downloaded off the Internet. The internal databases can be given the large, default limits. Databases managed by external sources can be given much smaller limits designed to prevent a denial of service attack. Developers might also want to use the Sq3LiteSetAuthorizer () interface to further control untrusted SQL. The size of the database created by an untrusted script can be contained using the max_page_count PRAGMA.

New run-time limit categories may be added in future releases.

Reference code from sqlite3:

SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
SQLITE_API int sqlite3_limit(sqlite3 *, int id, int newVal)

Definition at line 179 of file Sq3LiteC_sq3.h.

179 {
180 SQ3_INSTANCE_HDL(sq3lite);
181 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_limit(sq3lite->nat, id, newVal);
182 Sq3ErrorE_Check(sq3lite, errVal);
183 return MK_OK;
184 error:
185 return MK_ERROR;
186 }
+ Here is the caller graph for this function:

◆ Sq3LiteLimitP()

enum MkErrorE Sq3LiteLimitP ( SQ3_LITE sq3lite,
enum Sq3LimitE id,
MK_I32 newVal )

Non-inline replacement for Sq3LiteLimit

◆ Sq3LiteRollbackHook()

static MK_PTR Sq3LiteRollbackHook ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteRollbackHook_arg1 arg1,
MK_PTR arg2 )
inlinestatic

Commit And Rollback Notification Callbacks …

read more at 'Sq3LiteCommitHook'

Definition at line 189 of file Sq3LiteC_sq3.h.

189 {
190 SQ3_INSTANCE_HDL(sq3lite);
191 return (MK_PTR)sqlite3_rollback_hook(sq3lite->nat, arg1, (MK_PTR)(arg2));
192 }

◆ Sq3LiteRollbackHookP()

MK_PTR Sq3LiteRollbackHookP ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteRollbackHook_arg1 arg1,
MK_PTR arg2 )

Non-inline replacement for Sq3LiteRollbackHook

◆ Sq3LiteUpdateHook()

static MK_PTR Sq3LiteUpdateHook ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteUpdateHook_arg1 arg1,
MK_PTR arg2 )
inlinestatic

Data Change Notification Callbacks …

The Sq3LiteUpdateHook() interface registers a callback function with the database connection identified by the first argument to be invoked whenever a row is updated, inserted or deleted in a rowid table. Any callback set by a previous call to this function for the same database connection is overridden.

The second argument is a pointer to the function to invoke when a row is updated, inserted or deleted in a rowid table. The first argument to the callback is a copy of the third argument to Sq3LiteUpdateHook(). The second callback argument is one of SQ3_AUTHACTION_INSERT, SQ3_AUTHACTION_DELETE, or SQ3_AUTHACTION_UPDATE, depending on the operation that caused the callback to be invoked. The third and fourth arguments to the callback contain pointers to the database and table name containing the affected row. The final callback parameter is the rowid of the row. In the case of an update, this is the rowid after the update takes place.

The update hook is not invoked when internal system tables are modified (i.e. sqlite_sequence). The update hook is not invoked when WITHOUT ROWID tables are modified.

In the current implementation, the update hook is not invoked when conflicting rows are deleted because of an ON CONFLICT REPLACE clause. Nor is the update hook invoked when rows are deleted using the truncate optimization. The exceptions defined in this paragraph might change in a future release of SQLite.

The update hook implementation must not do anything that will modify the database connection that invoked the update hook. Any actions to modify the database connection must be deferred until after the completion of the Sq3StmtStep () call that triggered the update hook. Note that Sq3StmtPrepareV2 () and Sq3StmtStep () both modify their database connections for the meaning of "modify" in this paragraph.

The Sq3LiteUpdateHook(D,C,P) function returns the P argument from the previous call on the same database connection D, or NULL for the first call on D.

See also the Sq3LiteCommitHook (), Sq3LiteRollbackHook (), and sqlite3_preupdate_hook () interfaces.

Reference code from sqlite3:

void(*)(void *,int ,char const *,char const *,sqlite3_int64),
void*
);
sqlite_int64 sqlite3_int64
SQLITE_API void * sqlite3_update_hook(sqlite3 *, void(*)(void *, int, char const *, char const *, sqlite3_int64), void *)

Definition at line 195 of file Sq3LiteC_sq3.h.

195 {
196 SQ3_INSTANCE_HDL(sq3lite);
197 return (MK_PTR)sqlite3_update_hook(sq3lite->nat, arg1, (MK_PTR)(arg2));
198 }

◆ Sq3LiteUpdateHookP()

MK_PTR Sq3LiteUpdateHookP ( SQ3_LITE sq3lite,
Sq3Fupu_Sq3LiteUpdateHook_arg1 arg1,
MK_PTR arg2 )

Non-inline replacement for Sq3LiteUpdateHook