From 18657a960e125336f704ea058e25c27bd3900dcb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 19:28:19 +0200 Subject: Adding upstream version 3.40.1. Signed-off-by: Daniel Baumann --- www/c3ref/keyword_check.html | 176 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 www/c3ref/keyword_check.html (limited to 'www/c3ref/keyword_check.html') diff --git a/www/c3ref/keyword_check.html b/www/c3ref/keyword_check.html new file mode 100644 index 0000000..030c938 --- /dev/null +++ b/www/c3ref/keyword_check.html @@ -0,0 +1,176 @@ + + + + + +SQL Keyword Checking + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

SQL Keyword Checking

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

+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 sqlite3_keyword_count() interface returns the number of distinct +keywords understood by SQLite.

+ +

The sqlite3_keyword_name(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 sqlite3_keyword_name(N,Z,L) routine returns +SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z +or L are NULL or invalid pointers then calls to +sqlite3_keyword_name(N,Z,L) result in undefined behavior.

+ +

The sqlite3_keyword_check(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: +

+ +

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. +

See also lists of + Objects, + Constants, and + Functions.

+ -- cgit v1.2.3