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
Sq3Lite_Info_C_API

Sq3Lite PACKAGE - get information about the application … More...

+ Collaboration diagram for Sq3Lite_Info_C_API:

Functions

static enum MkErrorE Sq3Complete (MK_STRN sql)
 Determine If An SQL Statement Is Complete …
 
static enum MkErrorE Sq3KeywordCheck (MK_STRN arg0, MK_I32 arg1)
 SQL Keyword Checking …
 
static enum MkErrorE Sq3KeywordCount (void)
 SQL Keyword Checking …
 
static enum MkErrorE Sq3KeywordName (MK_I32 num, MK_STRN *kwd, MK_I32 *kwdsz)
 SQL Keyword Checking …
 
static enum MkErrorE Sq3Status (enum Sq3StatusE op, MK_I32 *pCurrent, MK_I32 *pHighwater, MK_BOOL resetFlag)
 SQLite Runtime Status …
 
static enum MkErrorE Sq3Status64 (enum Sq3StatusE op, MK_I64 *pCurrent, MK_I64 *pHighwater, MK_BOOL resetFlag)
 SQLite Runtime Status …
 
static enum MkErrorE Sq3KeywordNameBUF_RT (MK_RT mkrt, MK_I32 num, MK_BUF *kwd_out)
 SQL Keyword Checking …
 

Sq3Lite - Sq3Lite_Info_C_API - function

enum MkErrorE Sq3KeywordNameBUFP (MK_RT mkrt, MK_I32 num, MK_BUF *kwd_out)
 Non-inline replacement for Sq3KeywordNameBUF
 
enum MkErrorE Sq3CompleteP (MK_STRN sql)
 Non-inline replacement for Sq3Complete
 
enum MkErrorE Sq3KeywordCheckP (MK_STRN arg0, MK_I32 arg1)
 Non-inline replacement for Sq3KeywordCheck
 
enum MkErrorE Sq3KeywordCountP (void)
 Non-inline replacement for Sq3KeywordCount
 
enum MkErrorE Sq3KeywordNameP (MK_I32 num, MK_STRN *kwd, MK_I32 *kwdsz)
 Non-inline replacement for Sq3KeywordName
 
enum MkErrorE Sq3StatusP (enum Sq3StatusE op, MK_I32 *pCurrent, MK_I32 *pHighwater, MK_BOOL resetFlag)
 Non-inline replacement for Sq3Status
 
enum MkErrorE Sq3Status64P (enum Sq3StatusE op, MK_I64 *pCurrent, MK_I64 *pHighwater, MK_BOOL resetFlag)
 Non-inline replacement for Sq3Status64
 

Sq3Lite - Sq3Lite_Info_C_API - overload

#define Sq3KeywordNameBUF_NULL(...)
 
#define Sq3KeywordNameBUF(...)
 
#define Sq3KeywordNameBUF_E(...)
 
#define Sq3KeywordNameBUF_C(...)
 
#define Sq3KeywordNameBUF_e(...)
 
#define Sq3Complete_E(...)
 
#define Sq3Complete_C(...)
 
#define Sq3KeywordCheck_E(...)
 
#define Sq3KeywordCheck_C(...)
 
#define Sq3KeywordCount_E(...)
 
#define Sq3KeywordCount_C(...)
 
#define Sq3KeywordName_E(...)
 
#define Sq3KeywordName_C(...)
 
#define Sq3Status_E(...)
 
#define Sq3Status_C(...)
 
#define Sq3Status64_E(...)
 
#define Sq3Status64_C(...)
 

Detailed Description

Sq3Lite PACKAGE - get information about the application …

Macro Definition Documentation

◆ Sq3Complete_C

#define Sq3Complete_C ( ...)
Value:
if (MkErrorCheckI(Sq3Complete(__VA_ARGS__)))
static enum MkErrorE Sq3Complete(MK_STRN sql)
Determine If An SQL Statement Is Complete …

Definition at line 258 of file sqlite3_overload_sq3.h.

◆ Sq3Complete_E

#define Sq3Complete_E ( ...)
Value:
MkErrorCheck(Sq3Complete(__VA_ARGS__))

Definition at line 257 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordCheck_C

#define Sq3KeywordCheck_C ( ...)
Value:
if (MkErrorCheckI(Sq3KeywordCheck(__VA_ARGS__)))
static enum MkErrorE Sq3KeywordCheck(MK_STRN arg0, MK_I32 arg1)
SQL Keyword Checking …

Definition at line 260 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordCheck_E

#define Sq3KeywordCheck_E ( ...)
Value:
MkErrorCheck(Sq3KeywordCheck(__VA_ARGS__))

Definition at line 259 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordCount_C

#define Sq3KeywordCount_C ( ...)
Value:
if (MkErrorCheckI(Sq3KeywordCount(__VA_ARGS__)))
static enum MkErrorE Sq3KeywordCount(void)
SQL Keyword Checking …

Definition at line 262 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordCount_E

#define Sq3KeywordCount_E ( ...)
Value:
MkErrorCheck(Sq3KeywordCount(__VA_ARGS__))

Definition at line 261 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordName_C

#define Sq3KeywordName_C ( ...)
Value:
if (MkErrorCheckI(Sq3KeywordName(__VA_ARGS__)))
static enum MkErrorE Sq3KeywordName(MK_I32 num, MK_STRN *kwd, MK_I32 *kwdsz)
SQL Keyword Checking …

Definition at line 266 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordName_E

#define Sq3KeywordName_E ( ...)
Value:
MkErrorCheck(Sq3KeywordName(__VA_ARGS__))

Definition at line 265 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordNameBUF

#define Sq3KeywordNameBUF ( ...)
Value:
#define MK_RT_CALL
static enum MkErrorE Sq3KeywordNameBUF_RT(MK_RT mkrt, MK_I32 num, MK_BUF *kwd_out)
SQL Keyword Checking …

Definition at line 251 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordNameBUF_C

#define Sq3KeywordNameBUF_C ( ...)
Value:
if (MkErrorCheckI(Sq3KeywordNameBUF(__VA_ARGS__)))
#define Sq3KeywordNameBUF(...)

Definition at line 253 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordNameBUF_E

#define Sq3KeywordNameBUF_E ( ...)
Value:
MkErrorCheck(Sq3KeywordNameBUF(__VA_ARGS__))

Definition at line 252 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordNameBUF_e

#define Sq3KeywordNameBUF_e ( ...)
Value:
MK_EMBEDDED(MK_BUF,Sq3KeywordNameBUF,__VA_ARGS__)

Definition at line 254 of file sqlite3_overload_sq3.h.

◆ Sq3KeywordNameBUF_NULL

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

Definition at line 250 of file sqlite3_overload_sq3.h.

◆ Sq3Status64_C

#define Sq3Status64_C ( ...)
Value:
if (MkErrorCheckI(Sq3Status64(__VA_ARGS__)))
static enum MkErrorE Sq3Status64(enum Sq3StatusE op, MK_I64 *pCurrent, MK_I64 *pHighwater, MK_BOOL resetFlag)
SQLite Runtime Status …

Definition at line 270 of file sqlite3_overload_sq3.h.

◆ Sq3Status64_E

#define Sq3Status64_E ( ...)
Value:
MkErrorCheck(Sq3Status64(__VA_ARGS__))

Definition at line 269 of file sqlite3_overload_sq3.h.

◆ Sq3Status_C

#define Sq3Status_C ( ...)
Value:
if (MkErrorCheckI(Sq3Status(__VA_ARGS__)))
static enum MkErrorE Sq3Status(enum Sq3StatusE op, MK_I32 *pCurrent, MK_I32 *pHighwater, MK_BOOL resetFlag)
SQLite Runtime Status …

Definition at line 268 of file sqlite3_overload_sq3.h.

◆ Sq3Status_E

#define Sq3Status_E ( ...)
Value:
MkErrorCheck(Sq3Status(__VA_ARGS__))

Definition at line 267 of file sqlite3_overload_sq3.h.

Function Documentation

◆ Sq3Complete()

static enum MkErrorE Sq3Complete ( MK_STRN sql)
inlinestatic

Determine If An SQL Statement Is Complete …

These routines are useful during command-line input to determine if the currently entered text seems to form a complete SQL statement or if additional input is needed before sending the text into SQLite for parsing. These routines return 1 if the input string appears to be a complete SQL statement. A statement is judged to be complete if it ends with a semicolon token and is not a prefix of a well-formed CREATE TRIGGER statement. Semicolons that are embedded within string literals or quoted identifier names or comments are not independent tokens (they are part of the token in which they are embedded) and thus do not count as a statement terminator. Whitespace and comments that follow the final semicolon are ignored.

These routines return 0 if the statement is incomplete. If a memory allocation fails, then SQ3_RESULT_NOMEM is returned.

These routines do not parse the SQL statements thus will not detect syntactically incorrect SQL.

If SQLite has not been initialized using Sq3Initialize () prior to invoking sqlite3_complete16() then Sq3Initialize() is invoked automatically by sqlite3_complete16(). If that initialization fails, then the return value from sqlite3_complete16() will be non-zero regardless of whether or not the input SQL is complete.

The input to Sq3Complete () must be a zero-terminated UTF-8 string.

The input to sqlite3_complete16 () must be a zero-terminated UTF-16 string in native byte order.

Reference code from sqlite3:

SQLITE_API int sqlite3_complete(const char *sql);
SQLITE_API int sqlite3_complete16(const void *sql);
#define SQLITE_API
SQLITE_API int sqlite3_complete16(const void *sql)
SQLITE_API int sqlite3_complete(const char *sql)

Definition at line 704 of file LibSq3Lite_sq3.h.

704 {
705 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_complete(sql);
707 return MK_OK;
708 error:
709 return MK_ERROR;
710 }
MK_ERROR
MK_OK
Sq3ErrorE
Result Codes.
#define Sq3ErrorE_Check_Package(PROC)
+ Here is the caller graph for this function:

◆ Sq3CompleteP()

enum MkErrorE Sq3CompleteP ( MK_STRN sql)

Non-inline replacement for Sq3Complete

◆ Sq3KeywordCheck()

static enum MkErrorE Sq3KeywordCheck ( MK_STRN arg0,
MK_I32 arg1 )
inlinestatic

SQL Keyword Checking …

These routines provide access to the set of SQL language keywords recognized by SQLite. Applications can uses these routines to determine whether or not a specific identifier needs to be escaped (for example, by enclosing in double-quotes) so as not to confuse the parser.

The Sq3KeywordCount() interface returns the number of distinct keywords understood by SQLite.

The Sq3KeywordName(N,Z,L) interface finds the N-th keyword and makes *Z point to that keyword expressed as UTF8 and writes the number of bytes in the keyword into *L. The string that *Z points to is not zero-terminated. The Sq3KeywordName(N,Z,L) routine returns SQ3_RESULT_OK if N is within bounds and SQ3_RESULT_ERROR if not. If either Z or L are NULL or invalid pointers then calls to Sq3KeywordName(N,Z,L) result in undefined behavior.

The Sq3KeywordCheck(Z,L) interface checks to see whether or not the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero if it is and zero if not.

The parser used by SQLite is forgiving. It is often possible to use a keyword as an identifier as long as such use does not result in a parsing ambiguity. For example, the statement "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and creates a new table named "BEGIN" with three columns named "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid using keywords as identifiers. Common techniques used to avoid keyword name collisions include:

  • Put all identifier names inside double-quotes. This is the official SQL way to escape identifier names.
  • Put identifier names inside [...]. This is not standard SQL, but it is what SQL Server does and so lots of programmers use this technique.
  • Begin every identifier with the letter "Z" as no SQL keywords start with "Z".
  • Include a digit somewhere in every identifier name.

Note that the number of keywords understood by SQLite can depend on compile-time options. For example, "VACUUM" is not a keyword if SQLite is compiled with the -DSQLITE_OMIT_VACUUM option. Also, new keywords may be added to future releases of SQLite.

Reference code from sqlite3:

SQLITE_API int sqlite3_keyword_name(int,const char**,int*);
SQLITE_API int sqlite3_keyword_check(const char*,int);
SQLITE_API int sqlite3_keyword_check(const char *, int)
SQLITE_API int sqlite3_keyword_name(int, const char **, int *)
SQLITE_API int sqlite3_keyword_count(void)

Definition at line 713 of file LibSq3Lite_sq3.h.

713 {
714 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_keyword_check(arg0, arg1);
716 return MK_OK;
717 error:
718 return MK_ERROR;
719 }
+ Here is the caller graph for this function:

◆ Sq3KeywordCheckP()

enum MkErrorE Sq3KeywordCheckP ( MK_STRN arg0,
MK_I32 arg1 )

Non-inline replacement for Sq3KeywordCheck

◆ Sq3KeywordCount()

static enum MkErrorE Sq3KeywordCount ( void )
inlinestatic

SQL Keyword Checking …

read more at 'Sq3KeywordCheck'

Definition at line 722 of file LibSq3Lite_sq3.h.

722 {
723 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_keyword_count();
725 return MK_OK;
726 error:
727 return MK_ERROR;
728 }
+ Here is the caller graph for this function:

◆ Sq3KeywordCountP()

enum MkErrorE Sq3KeywordCountP ( void )

Non-inline replacement for Sq3KeywordCount

◆ Sq3KeywordName()

static enum MkErrorE Sq3KeywordName ( MK_I32 num,
MK_STRN * kwd,
MK_I32 * kwdsz )
inlinestatic

SQL Keyword Checking …

read more at 'Sq3KeywordCheck'

Definition at line 733 of file LibSq3Lite_sq3.h.

733 {
734 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_keyword_name(num, kwd, kwdsz);
736 return MK_OK;
737 error:
738 return MK_ERROR;
739 }
+ Here is the caller graph for this function:

◆ Sq3KeywordNameBUF_RT()

static enum MkErrorE Sq3KeywordNameBUF_RT ( MK_RT mkrt,
MK_I32 num,
MK_BUF * kwd_out )
inlinestatic

SQL Keyword Checking …

read more at 'Sq3KeywordCheck'

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]numThe keyword-number
[out]kwd_outThe return-value have to be not null.
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
Attention
(do not free) The memory of the kwd_out value belongs to the called Sq3KeywordNameBUF function and therefore never becomes null for a non-error result.
For details on the kwd_out value, see: MkKernel_Storage_C_API.

Definition at line 1000 of file LibSq3Lite_sq3.h.

1004 {
1005 assert(kwd_out != NULL);
1007
1008 MkBufferCreateTLS_T(MkBuffer64C,buf,0);
1009 MK_STRN kwd ;
1010 MK_I32 kwdsz ;
1011 Sq3KeywordName_E(num,&kwd,&kwdsz);
1012 MkBufferSizeNew(buf,kwdsz+1);
1013 strncpy(bufR.super.buf.storage.first.S,kwd,(size_t)kwdsz);
1014 bufR.super.buf.storage.first.S[kwdsz] = '\0';
1015 *kwd_out = buf;
1016 return MK_OK;
1017error:
1019}
#define MkBufferSizeNew(...)
#define MkBufferCreateTLS_T(cls, name, size)
#define MkErrorStack_1X(...)
const MK_STRB * MK_STRN
signed int MK_I32
__thread MK_TYP Sq3LiteC_TT
class as MkTypeDefS-class-type …
#define Sq3KeywordName_E(...)
#define SQ3_STATIC_RT

◆ Sq3KeywordNameBUFP()

enum MkErrorE Sq3KeywordNameBUFP ( MK_RT mkrt,
MK_I32 num,
MK_BUF * kwd_out )

Non-inline replacement for Sq3KeywordNameBUF

◆ Sq3KeywordNameP()

enum MkErrorE Sq3KeywordNameP ( MK_I32 num,
MK_STRN * kwd,
MK_I32 * kwdsz )

Non-inline replacement for Sq3KeywordName

◆ Sq3Status()

static enum MkErrorE Sq3Status ( enum Sq3StatusE op,
MK_I32 * pCurrent,
MK_I32 * pHighwater,
MK_BOOL resetFlag )
inlinestatic

SQLite Runtime Status …

These interfaces are used to retrieve runtime status information about the performance of SQLite, and optionally to reset various highwater marks. The first argument is an integer code for the specific parameter to measure. Recognized integer codes are of the form SQ3_STATUS_.... The current value of the parameter is returned into *pCurrent. The highest recorded value is returned in *pHighwater. If the resetFlag is true, then the highest record value is reset after pHighwater is written. Some parameters do not record the highest value. For those parameters nothing is written into *pHighwater and the resetFlag is ignored. Other parameters record only the highwater mark and not the current value. For these latter parameters nothing is written into *pCurrent.

The Sq3Status() and Sq3Status64() routines return SQ3_RESULT_OK on success and a non-zero error code on failure.

If either the current value or the highwater mark is too large to be represented by a 32-bit integer, then the values returned by Sq3Status() are undefined.

See also: Sq3LiteDbStatus ()

Reference code from sqlite3:

SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
int op,
sqlite3_int64 *pCurrent,
sqlite3_int64 *pHighwater,
int resetFlag
);
sqlite_int64 sqlite3_int64
SQLITE_API int sqlite3_status64(int op, sqlite3_int64 *pCurrent, sqlite3_int64 *pHighwater, int resetFlag)
SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag)

Definition at line 742 of file LibSq3Lite_sq3.h.

742 {
743 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_status(op, pCurrent, pHighwater, resetFlag);
745 return MK_OK;
746 error:
747 return MK_ERROR;
748 }
+ Here is the caller graph for this function:

◆ Sq3Status64()

static enum MkErrorE Sq3Status64 ( enum Sq3StatusE op,
MK_I64 * pCurrent,
MK_I64 * pHighwater,
MK_BOOL resetFlag )
inlinestatic

SQLite Runtime Status …

read more at 'Sq3Status'

Definition at line 751 of file LibSq3Lite_sq3.h.

751 {
752 enum Sq3ErrorE errVal = (enum Sq3ErrorE)sqlite3_status64(op, pCurrent, pHighwater, resetFlag);
754 return MK_OK;
755 error:
756 return MK_ERROR;
757 }
+ Here is the caller graph for this function:

◆ Sq3Status64P()

enum MkErrorE Sq3Status64P ( enum Sq3StatusE op,
MK_I64 * pCurrent,
MK_I64 * pHighwater,
MK_BOOL resetFlag )

Non-inline replacement for Sq3Status64

◆ Sq3StatusP()

enum MkErrorE Sq3StatusP ( enum Sq3StatusE op,
MK_I32 * pCurrent,
MK_I32 * pHighwater,
MK_BOOL resetFlag )

Non-inline replacement for Sq3Status