Sq3StmtC - get type-information … More...
Functions | |
static SQ3_LITE | Sq3StmtDbHandle (SQ3_STMT sq3stmt) |
Find The Database Handle Of A Prepared Statement … | |
static enum MkErrorE | Sq3StmtBusy (SQ3_STMT sq3stmt) |
Determine If A Prepared Statement Has Been Reset … | |
static enum MkErrorE | Sq3StmtDataCount (SQ3_STMT pStmt) |
Number of columns in a result set … | |
static enum MkErrorE | Sq3StmtIsExplain (SQ3_STMT pStmt) |
Query The EXPLAIN Setting For A Prepared Statement … | |
static enum MkErrorE | Sq3StmtReadonly (SQ3_STMT pStmt) |
Determine If An SQL Statement Writes The Database … | |
static enum MkErrorE | Sq3StmtStatus (SQ3_STMT sq3stmt, enum Sq3StmtStatusE op, MK_BOOL resetFlg) |
Prepared Statement Status … | |
void | Sq3StmtLog_RT (MK_RT mkrt, SQ3_STMT const stmt, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl) |
log the val … | |
Sq3StmtC - Sq3StmtC_Info_C_API - function | |
SQ3_LITE | Sq3StmtDbHandleP (SQ3_STMT sq3stmt) |
Non-inline replacement for Sq3StmtDbHandle … | |
enum MkErrorE | Sq3StmtBusyP (SQ3_STMT sq3stmt) |
Non-inline replacement for Sq3StmtBusy … | |
enum MkErrorE | Sq3StmtDataCountP (SQ3_STMT pStmt) |
Non-inline replacement for Sq3StmtDataCount … | |
enum MkErrorE | Sq3StmtIsExplainP (SQ3_STMT pStmt) |
Non-inline replacement for Sq3StmtIsExplain … | |
enum MkErrorE | Sq3StmtReadonlyP (SQ3_STMT pStmt) |
Non-inline replacement for Sq3StmtReadonly … | |
enum MkErrorE | Sq3StmtStatusP (SQ3_STMT sq3stmt, enum Sq3StmtStatusE op, MK_BOOL resetFlg) |
Non-inline replacement for Sq3StmtStatus … | |
Sq3StmtC - Sq3StmtC_Info_C_API - overload | |
#define | Sq3StmtBusy_E(...) |
#define | Sq3StmtBusy_C(...) |
#define | Sq3StmtDataCount_E(...) |
#define | Sq3StmtDataCount_C(...) |
#define | Sq3StmtIsExplain_E(...) |
#define | Sq3StmtIsExplain_C(...) |
#define | Sq3StmtLog_NULL(...) |
#define | Sq3StmtLog(...) |
#define | Sq3StmtLog_4(stmt, fmtobj, debug, callfunc) |
#define | Sq3StmtLog_3(stmt, fmtobj, debug) |
#define | Sq3StmtLog_2(stmt, fmtobj) |
#define | Sq3StmtLog_1(stmt) |
#define | Sq3StmtReadonly_E(...) |
#define | Sq3StmtReadonly_C(...) |
#define | Sq3StmtStatus_E(...) |
#define | Sq3StmtStatus_C(...) |
Sq3StmtC - get type-information …
#define Sq3StmtBusy_C | ( | ... | ) |
Definition at line 604 of file sqlite3_overload_sq3.h.
#define Sq3StmtBusy_E | ( | ... | ) |
Definition at line 603 of file sqlite3_overload_sq3.h.
#define Sq3StmtDataCount_C | ( | ... | ) |
Definition at line 606 of file sqlite3_overload_sq3.h.
#define Sq3StmtDataCount_E | ( | ... | ) |
Definition at line 605 of file sqlite3_overload_sq3.h.
#define Sq3StmtIsExplain_C | ( | ... | ) |
Definition at line 608 of file sqlite3_overload_sq3.h.
#define Sq3StmtIsExplain_E | ( | ... | ) |
Definition at line 607 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog | ( | ... | ) |
Definition at line 610 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog_1 | ( | stmt | ) |
Definition at line 614 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog_2 | ( | stmt, | |
fmtobj ) |
Definition at line 613 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog_3 | ( | stmt, | |
fmtobj, | |||
debug ) |
Definition at line 612 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog_4 | ( | stmt, | |
fmtobj, | |||
debug, | |||
callfunc ) |
Definition at line 611 of file sqlite3_overload_sq3.h.
#define Sq3StmtLog_NULL | ( | ... | ) |
Definition at line 609 of file sqlite3_overload_sq3.h.
#define Sq3StmtReadonly_C | ( | ... | ) |
Definition at line 616 of file sqlite3_overload_sq3.h.
#define Sq3StmtReadonly_E | ( | ... | ) |
Definition at line 615 of file sqlite3_overload_sq3.h.
#define Sq3StmtStatus_C | ( | ... | ) |
Definition at line 618 of file sqlite3_overload_sq3.h.
#define Sq3StmtStatus_E | ( | ... | ) |
Definition at line 617 of file sqlite3_overload_sq3.h.
Determine If A Prepared Statement Has Been Reset …
The Sq3StmtBusy(S) interface returns true (non-zero) if the prepared statement S has been stepped at least once using Sq3StmtStep (S) but has neither run to completion (returned SQ3_RESULT_DONE from Sq3StmtStep (S)) nor been reset using Sq3StmtReset (S). The Sq3StmtBusy(S) interface returns false if S is a NULL pointer. If S is not a NULL pointer and is not a pointer to a valid prepared statement object, then the behavior is undefined and probably undesirable.
This interface can be used in combination Sq3StmtNextStmt () to locate all prepared statements associated with a database connection that are in need of being reset. This can be used, for example, in diagnostic routines to search for prepared statements that are holding a transaction open.
Reference code from sqlite3:
Definition at line 306 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtBusy …
Number of columns in a result set …
The Sq3StmtDataCount(P) interface returns the number of columns in the current row of the result set of prepared statement P. If prepared statement P does not have results ready to return (via calls to the sqlite3_column() family of interfaces) then Sq3StmtDataCount(P) returns 0. The Sq3StmtDataCount(P) routine also returns 0 if P is a NULL pointer. The Sq3StmtDataCount(P) routine returns 0 if the previous call to Sq3StmtStep(P) returned SQ3_RESULT_DONE. The Sq3StmtDataCount(P) will return non-zero if previous call to Sq3StmtStep(P) returned SQ3_RESULT_ROW, except in the case of the PRAGMA incremental_vacuum where it always returns zero since each step of that multi-step pragma returns 0 columns of data.
See also: Sq3StmtColumnCount ()
Reference code from sqlite3:
Definition at line 316 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtDataCount …
Find The Database Handle Of A Prepared Statement …
The Sq3StmtDbHandle interface returns the database connection handle to which a prepared statement belongs. The database connection returned by Sq3StmtDbHandle is the same database connection that was the first argument to the Sq3StmtPrepareV2 () call (or its variants) that was used to create the statement in the first place.
Reference code from sqlite3:
Definition at line 298 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtDbHandle …
Query The EXPLAIN Setting For A Prepared Statement …
The Sq3StmtIsExplain(S) interface returns 1 if the prepared statement S is an EXPLAIN statement, or 2 if the statement S is an EXPLAIN QUERY PLAN. The Sq3StmtIsExplain(S) interface returns 0 if S is an ordinary statement or a NULL pointer.
Reference code from sqlite3:
Definition at line 326 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtIsExplain …
void Sq3StmtLog_RT | ( | MK_RT | mkrt, |
SQ3_STMT const | stmt, | ||
MK_OBJN | fmtobj, | ||
MK_DBG const | debug, | ||
MK_STRN const | callfunc, | ||
MK_I32 const | lvl ) |
log the val …
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | stmt | Programming-Language-Micro-Kernel (PLMK) instance from sqlite3_stmt |
[in] | fmtobj | managed object used to format the log-message (default="MK_NULL" → use default-format) |
[in] | debug | the debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0 ) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | lvl | a user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0 ) |
Determine If An SQL Statement Writes The Database …
The Sq3StmtReadonly(X) interface returns true (non-zero) if and only if the prepared statement X makes no direct changes to the content of the database file.
Note that application-defined SQL functions or virtual tables might change the database indirectly as a side effect. For example, if an application defines a function "eval()" that calls Sq3LiteExec (), then the following SQL statement would change the database file through side-effects:
SELECT eval('DELETE FROM t1') FROM t2;
But because the SELECT statement does not change the database file directly, Sq3StmtReadonly() would still return true.
Transaction control statements such as BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE cause Sq3StmtReadonly() to return true, since the statements themselves do not actually modify the database but rather they control the timing of when other statements modify the database. The ATTACH and DETACH statements also cause Sq3StmtReadonly() to return true since, while those statements change the configuration of a database connection, they do not make changes to the content of the database files on disk. The Sq3StmtReadonly() interface returns true for BEGIN since BEGIN merely sets internal flags, but the BEGIN IMMEDIATE and BEGIN EXCLUSIVE commands do touch the database and so Sq3StmtReadonly() returns false for those commands.
This routine returns false if there is any possibility that the statement might change the database file. A false return does not guarantee that the statement will change the database file. For example, an UPDATE statement might have a WHERE clause that makes it a no-op, but the Sq3StmtReadonly() result would still be false. Similarly, a CREATE TABLE IF NOT EXISTS statement is a read-only no-op if the table already exists, but Sq3StmtReadonly() still returns false for such a statement.
If prepared statement X is an EXPLAIN or EXPLAIN QUERY PLAN statement, then Sq3StmtReadonly(X) returns the same value as if the EXPLAIN or EXPLAIN QUERY PLAN prefix were omitted.
Reference code from sqlite3:
Definition at line 336 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtReadonly …
|
inlinestatic |
Prepared Statement Status …
Each prepared statement maintains various SQ3_STMTSTATUS counters that measure the number of times it has performed specific operations. These counters can be used to monitor the performance characteristics of the prepared statements. For example, if the number of table steps greatly exceeds the number of table searches or result rows, that would tend to indicate that the prepared statement is using a full table scan rather than an index.
This interface is used to retrieve and reset counter values from a prepared statement. The first argument is the prepared statement object to be interrogated. The second argument is an integer code for a specific SQ3_STMTSTATUS counter to be interrogated. The current value of the requested counter is returned. If the resetFlg is true, then the counter is reset to zero after this interface call returns.
See also: Sq3Status () and Sq3LiteDbStatus ().
Reference code from sqlite3:
Definition at line 346 of file Sq3StmtC_sq3.h.
enum MkErrorE Sq3StmtStatusP | ( | SQ3_STMT | sq3stmt, |
enum Sq3StmtStatusE | op, | ||
MK_BOOL | resetFlg ) |
Non-inline replacement for Sq3StmtStatus …