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 ...
|
SQLite Session Module C/C++ Interface
(session.html)
... Or, if argument zTab is NULL, then changes are recorded for all tables
in the database. If additional tables are added to the database (by
executing "CREATE TABLE" statements) after this call is made, changes for
the new tables are ...
|
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 ...
|
C API: Count The Number Of Rows Modified
(c3ref/changes.html)
sqlite3_changes(), sqlite3_changes64()
... For the purposes of this interface, a CREATE TABLE AS SELECT statement
does not count as an INSERT, UPDATE or DELETE statement and hence the rows
added to the new table by the CREATE TABLE AS SELECT statement are not ...
|
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 ...
|
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 ...
|
C API: Declared Datatype Of A Query Result
(c3ref/column_decltype.html)
sqlite3_column_decltype(), sqlite3_column_decltype16()
... CREATE TABLE t1(c1 VARIANT);
and the following statement to be compiled:
SELECT c1 + 1, c1 FROM t1;
this routine would return the string "VARIANT" for the second result
column (i==1), and a NULL pointer for the first result ...
|
Page generated by FTS5 in about 256.01 ms.