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_Info_C_API

Sq3LiteC - get informationMore...

+ Collaboration diagram for Sq3LiteC_Info_C_API:

Functions

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 …
 

Sq3LiteC - Sq3LiteC_Info_C_API - function

MK_I32 Sq3LiteGetAutocommitP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteGetAutocommit
 
MK_I64 Sq3LiteLastInsertRowidP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteLastInsertRowid
 
enum MkErrorE Sq3LiteTxnStateP (SQ3_LITE sq3lite, MK_STRN zSchema)
 Non-inline replacement for Sq3LiteTxnState
 
enum MkErrorE Sq3LiteVtabOnConflictP (SQ3_LITE sq3lite)
 Non-inline replacement for Sq3LiteVtabOnConflict
 

Sq3LiteC - Sq3LiteC_Info_C_API - overload

#define Sq3LiteTxnState_E(...)
 
#define Sq3LiteTxnState_C(...)
 
#define Sq3LiteVtabOnConflict_E(...)
 
#define Sq3LiteVtabOnConflict_C(...)
 

Detailed Description

Sq3LiteC - get information

Macro Definition Documentation

◆ Sq3LiteTxnState_C

#define Sq3LiteTxnState_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteTxnState(__VA_ARGS__)))
static enum MkErrorE Sq3LiteTxnState(SQ3_LITE sq3lite, MK_STRN zSchema)
Determine the transaction state of a database …

Definition at line 413 of file sqlite3_overload_sq3.h.

◆ Sq3LiteTxnState_E

#define Sq3LiteTxnState_E ( ...)
Value:
MkErrorCheck(Sq3LiteTxnState(__VA_ARGS__))

Definition at line 412 of file sqlite3_overload_sq3.h.

◆ Sq3LiteVtabOnConflict_C

#define Sq3LiteVtabOnConflict_C ( ...)
Value:
if (MkErrorCheckI(Sq3LiteVtabOnConflict(__VA_ARGS__)))
static enum MkErrorE Sq3LiteVtabOnConflict(SQ3_LITE sq3lite)
Determine The Virtual Table Conflict Policy …

Definition at line 415 of file sqlite3_overload_sq3.h.

◆ Sq3LiteVtabOnConflict_E

#define Sq3LiteVtabOnConflict_E ( ...)
Value:
MkErrorCheck(Sq3LiteVtabOnConflict(__VA_ARGS__))

Definition at line 414 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3LiteGetAutocommit()

static MK_I32 Sq3LiteGetAutocommit ( SQ3_LITE sq3lite)
inlinestatic

Test For Auto-Commit Mode …

The Sq3LiteGetAutocommit() interface returns non-zero or zero if the given database connection is or is not in autocommit mode, respectively. Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN statement. Autocommit mode is re-enabled by a COMMIT or ROLLBACK.

If certain kinds of errors occur on a statement within a multi-statement transaction (errors including SQ3_RESULT_FULL, SQ3_RESULT_IOERR, SQ3_RESULT_NOMEM, SQ3_RESULT_BUSY, and SQ3_RESULT_INTERRUPT) then the transaction might be rolled back automatically. The only way to find out whether SQLite automatically rolled back the transaction after an error is to use this function.

If another thread changes the autocommit status of the database connection while this routine is running, then the return value is undefined.

Reference code from sqlite3:

struct sqlite3 sqlite3
#define SQLITE_API
SQLITE_API int sqlite3_get_autocommit(sqlite3 *)

Definition at line 284 of file Sq3LiteC_sq3.h.

284 {
285 SQ3_INSTANCE_HDL(sq3lite);
286 return sqlite3_get_autocommit(sq3lite->nat);
287 }
#define SQ3_INSTANCE_HDL(x)
sqlite3 * nat
internal - link between Sq3LiteS and native library
+ Here is the caller graph for this function:

◆ Sq3LiteGetAutocommitP()

MK_I32 Sq3LiteGetAutocommitP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteGetAutocommit

◆ Sq3LiteLastInsertRowid()

static MK_I64 Sq3LiteLastInsertRowid ( SQ3_LITE sq3lite)
inlinestatic

Last Insert Rowid …

Each entry in most SQLite tables (except for WITHOUT ROWID tables) has a unique 64-bit signed integer key called the "rowid". The rowid is always available as an undeclared column named ROWID, OID, or ROWID as long as those names are not also used by explicitly declared columns. If the table has a column of type INTEGER PRIMARY KEY then that column is another alias for the rowid.

The Sq3LiteLastInsertRowid(D) interface usually returns the rowid of the most recent successful INSERT into a rowid table or virtual table on database connection D. Inserts into WITHOUT ROWID tables are not recorded. If no successful INSERTs into rowid tables have ever occurred on the database connection D, then Sq3LiteLastInsertRowid(D) returns zero.

As well as being set automatically as rows are inserted into database tables, the value returned by this function may be set explicitly by Sq3LiteSetLastInsertRowid ()

Some virtual table implementations may INSERT rows into rowid tables as part of committing a transaction (e.g. to flush data accumulated in memory to disk). In this case subsequent calls to this function return the rowid associated with these internal INSERT operations, which leads to unintuitive results. Virtual table implementations that do write to rowid tables in this way can avoid this problem by restoring the original rowid value using Sq3LiteSetLastInsertRowid () before returning control to the user.

If an INSERT occurs within a trigger then this routine will return the rowid of the inserted row as long as the trigger is running. Once the trigger program ends, the value returned by this routine reverts to what it was before the trigger was fired.

An INSERT that fails due to a constraint violation is not a successful INSERT and does not change the value returned by this routine. Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, and INSERT OR ABORT make no changes to the return value of this routine when their insertion fails. When INSERT OR REPLACE encounters a constraint violation, it does not fail. The INSERT continues to completion after deleting rows that caused the constraint problem so INSERT OR REPLACE will always change the return value of this interface.

For the purposes of this routine, an INSERT is considered to be successful even if it is subsequently rolled back.

This function is accessible to SQL statements via the last_insert_rowid() SQL function.

If a separate thread performs a new INSERT on the same database connection while the Sq3LiteLastInsertRowid () function is running and thus changes the last insert rowid, then the value returned by Sq3LiteLastInsertRowid () is unpredictable and might not equal either the old or the new last insert rowid.

Reference code from sqlite3:

sqlite_int64 sqlite3_int64
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3 *)

Definition at line 290 of file Sq3LiteC_sq3.h.

290 {
291 SQ3_INSTANCE_HDL(sq3lite);
292 return sqlite3_last_insert_rowid(sq3lite->nat);
293 }
+ Here is the caller graph for this function:

◆ Sq3LiteLastInsertRowidP()

MK_I64 Sq3LiteLastInsertRowidP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteLastInsertRowid

◆ Sq3LiteTxnState()

static enum MkErrorE Sq3LiteTxnState ( SQ3_LITE sq3lite,
MK_STRN zSchema )
inlinestatic

Determine the transaction state of a database …

The Sq3LiteTxnState(D,S) interface returns the current transaction state of schema S in database connection D. If S is NULL, then the highest transaction state of any schema on database connection D is returned. Transaction states are (in order of lowest to highest):

  1. SQ3_TXN_NONE
  2. SQ3_TXN_READ
  3. SQ3_TXN_WRITE

If the S argument to Sq3LiteTxnState(D,S) is not the name of a valid schema, then -1 is returned.

Reference code from sqlite3:

SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema);
SQLITE_API int sqlite3_txn_state(sqlite3 *, const char *zSchema)

Definition at line 296 of file Sq3LiteC_sq3.h.

296 {
297 SQ3_INSTANCE_HDL(sq3lite);
298 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_txn_state(sq3lite->nat, zSchema);
299 Sq3ErrorE_Check(sq3lite, errVal);
300 return MK_OK;
301 error:
302 return MK_ERROR;
303 }
MK_ERROR
MK_OK
Sq3ErrorE
Result Codes.
#define Sq3ErrorE_Check(sq3_hdl, PROC)
check on a tclsq3lite error and convert into a tclsq3lite error …
+ Here is the caller graph for this function:

◆ Sq3LiteTxnStateP()

enum MkErrorE Sq3LiteTxnStateP ( SQ3_LITE sq3lite,
MK_STRN zSchema )

Non-inline replacement for Sq3LiteTxnState

◆ Sq3LiteVtabOnConflict()

static enum MkErrorE Sq3LiteVtabOnConflict ( SQ3_LITE sq3lite)
inlinestatic

Determine The Virtual Table Conflict Policy …

This function may only be called from within a call to the xUpdate method of a virtual table implementation for an INSERT or UPDATE operation. The value returned is one of SQ3_CONFLICT_ROLLBACK, SQ3_AUTHRETURN_IGNORE, SQ3_CONFLICT_FAIL, SQ3_RESULT_ABORT, or SQ3_CONFLICT_REPLACE, according to the ON CONFLICT mode of the SQL statement that triggered the call to the xUpdate method of the virtual table.

Reference code from sqlite3:

SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *)

Definition at line 306 of file Sq3LiteC_sq3.h.

306 {
307 SQ3_INSTANCE_HDL(sq3lite);
308 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_vtab_on_conflict(sq3lite->nat);
309 Sq3ErrorE_Check(sq3lite, errVal);
310 return MK_OK;
311 error:
312 return MK_ERROR;
313 }
+ Here is the caller graph for this function:

◆ Sq3LiteVtabOnConflictP()

enum MkErrorE Sq3LiteVtabOnConflictP ( SQ3_LITE sq3lite)

Non-inline replacement for Sq3LiteVtabOnConflict