From 63847496f14c813a5d80efd5b7de0f1294ffe1e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:07:11 +0200 Subject: Adding upstream version 3.45.1. Signed-off-by: Daniel Baumann --- www/c3ref/complete.html | 161 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 www/c3ref/complete.html (limited to 'www/c3ref/complete.html') diff --git a/www/c3ref/complete.html b/www/c3ref/complete.html new file mode 100644 index 0000000..d99f322 --- /dev/null +++ b/www/c3ref/complete.html @@ -0,0 +1,161 @@ + + + + + +Determine If An SQL Statement Is Complete + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Determine If An SQL Statement Is Complete

+
+
+int sqlite3_complete(const char *sql);
+int sqlite3_complete16(const void *sql);
+
+

+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 SQLITE_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 sqlite3_initialize() prior +to invoking sqlite3_complete16() then sqlite3_initialize() 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 sqlite3_complete() 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. +

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

+ -- cgit v1.2.3