Pragma statements supported by SQLite
(pragma.html)
PRAGMA legacy_alter_table
... More specifically,
when this flag is on
the ALTER TABLE RENAME command only rewrites the initial occurrence
of the table name in its CREATE TABLE statement and in any associated
CREATE INDEX and CREATE TRIGGER statements. Other references to the ...
|
C API: Determine The Collation For a Virtual Table Constraint
(c3ref/vtab_collation.html)
sqlite3_vtab_collation()
... If there is no COLLATE operator, but the column that is the subject
of the constraint specifies an alternative collating sequence via
a COLLATE clause on the column definition within the CREATE TABLE
statement that was passed into sqlite3_declare_vtab(), then ...
|
UPSERT
(lang_upsert.html)
... To use the
value that would have been inserted had the constraint not failed,
add the special "excluded." table qualifier to the column name.
2.1. Examples
Some examples will help illustrate how UPSERT works:
CREATE TABLE vocabulary(word TEXT ...
|
The WITH Clause
(lang_with.html)
... CREATE TABLE checkin(
id INTEGER PRIMARY KEY,
mtime INTEGER -- timestamp when this checkin occurred
);
CREATE TABLE derivedfrom(
xfrom INTEGER NOT NULL REFERENCES checkin, -- parent checkin
xto INTEGER NOT NULL REFERENCES checkin, -- derived checkin
PRIMARY KEY(xfrom,xto)
);
CREATE INDEX derivedfrom_back ...
|
The Spellfix1 Virtual Table
(spellfix1.html)
1. Overview
... Once the spellfix1 extension is loaded, an instance of the spellfix1
virtual table is created like this:
CREATE VIRTUAL TABLE demo USING spellfix1;
The "spellfix1" term is the name of the spellfix module and must be
entered as shown. The ...
|
Profiling SQL Queries
(profile.html)
2. Simple Cases - Rows, Loops and Cycles
... CREATE VIRTUAL TABLE ft USING fts5(text);
CREATE TABLE t1(a, b);
CREATE TABLE t2(c INTEGER PRIMARY KEY, d);
Then, after first executing ".scanstats on":
sqlite3> SELECT * FROM t1, t2 WHERE t2.c=t1.a;
<...query results...> ...
|
The SQLITE_STMT Virtual Table
(stmt.html)
2.1. Columns
The columns are provided by the SQLITE_STMT virtual table are summarized by
the hypothetical CREATE TABLE statement show here:
CREATE TABLE sqlite_stmt(
sql TEXT, -- Original SQL text
ncol INT, -- Number of output columns
ro BOOLEAN, -- True for "read only" statements ...
|
C API: SQL Keyword Checking
(c3ref/keyword_check.html)
sqlite3_keyword_count(), sqlite3_keyword_name(), sqlite3_keyword_check()
... 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 ...
|
EXPLAIN QUERY PLAN
(eqp.html)
1.1. Table and Index Scans
When processing a SELECT (or other) statement, SQLite may retrieve data from
database tables in a variety of ways. It may scan through all the records in
a table (a full-table scan), scan a contiguous subset of the records ...
|
The Session Extension
(sessionintro.html)
3.1. Capturing a Changeset
... Pointer to changeset blob */
){
sqlite3_session *pSession = 0;
int rc;
/* Create a new session object */
rc = sqlite3session_create(db, "main", &pSession);
/* Configure the session object to record changes to all tables */
if( rc==SQLITE_OK ) rc = sqlite3session_attach(pSession, NULL);
/* Execute the SQL script ...
|
Page generated by FTS5 in about 144.66 ms.