pub enum Statement {
Show 24 variants
Empty,
Select(SelectId),
Insert(Box<Insert>),
Update(Box<Update>),
Delete(Box<Delete>),
CreateTable {
temporary: bool,
if_not_exists: bool,
database: Option<NameId>,
name: NameId,
body: CreateTableBody,
},
CreateIndex {
unique: bool,
if_not_exists: bool,
database: Option<NameId>,
name: NameId,
table: NameId,
using: Option<NameId>,
columns: Vec<IndexedColumn>,
settings: Vec<Vec<u8>>,
filter: Option<ExprId>,
},
CreateView {
temporary: bool,
if_not_exists: bool,
database: Option<NameId>,
name: NameId,
columns: Vec<NameId>,
select: SelectId,
},
CreateTrigger {
temporary: bool,
if_not_exists: bool,
database: Option<NameId>,
name: NameId,
time: Option<TriggerTime>,
event: TriggerEvent,
table: NameId,
table_database: Option<NameId>,
for_each_row: bool,
when: Option<ExprId>,
body: Vec<Statement>,
},
CreateVirtualTable {
if_not_exists: bool,
database: Option<NameId>,
name: NameId,
module: NameId,
arguments: Vec<Vec<u8>>,
},
Drop {
kind: ObjectKind,
if_exists: bool,
database: Option<NameId>,
name: NameId,
},
AlterTable {
database: Option<NameId>,
table: NameId,
action: AlterAction,
},
Begin {
behaviour: Option<TransactionBehaviour>,
},
Commit,
Rollback {
savepoint: Option<NameId>,
},
Savepoint(NameId),
Release(NameId),
Pragma {
database: Option<NameId>,
name: NameId,
value: PragmaValue,
},
Attach {
file: ExprId,
schema: ExprId,
key: Option<ExprId>,
},
Detach {
schema: ExprId,
},
Vacuum {
database: Option<NameId>,
into: Option<ExprId>,
},
Analyze {
database: Option<NameId>,
name: Option<NameId>,
},
Reindex {
database: Option<NameId>,
name: Option<NameId>,
},
Explain {
query_plan: bool,
inner: Box<Statement>,
},
}Expand description
A parsed statement.
Variants§
Empty
An empty statement, which SQLite compiles to nothing.
Select(SelectId)
SELECT or VALUES.
Insert(Box<Insert>)
INSERT or REPLACE.
Update(Box<Update>)
UPDATE.
Delete(Box<Delete>)
DELETE.
CreateTable
CREATE TABLE.
Fields
body: CreateTableBodyThe body.
CreateIndex
CREATE INDEX.
Fields
using: Option<NameId>The module named by USING, when one was.
SQLite has no USING on CREATE INDEX; PostgreSQL does, and it is
how pgvector spells USING hnsw. This engine borrows the spelling
for the same purpose: an index whose structure is not a b-tree.
A plain CREATE INDEX leaves it None and nothing
downstream changes.
columns: Vec<IndexedColumn>The key columns.
CreateView
CREATE VIEW.
Fields
CreateTrigger
CREATE TRIGGER.
CreateVirtualTable
CREATE VIRTUAL TABLE.
Fields
Drop
DROP TABLE|INDEX|VIEW|TRIGGER.
Fields
kind: ObjectKindWhich kind of object.
AlterTable
ALTER TABLE.
Fields
action: AlterActionWhat to do to it.
Begin
BEGIN.
Fields
behaviour: Option<TransactionBehaviour>DEFERRED, IMMEDIATE or EXCLUSIVE, when written.
Commit
COMMIT or END.
Rollback
ROLLBACK [TO savepoint].
Savepoint(NameId)
SAVEPOINT name.
Release(NameId)
RELEASE [SAVEPOINT] name.
Pragma
PRAGMA.
Fields
value: PragmaValueThe argument.
Attach
ATTACH.
Fields
Detach
DETACH.
Vacuum
VACUUM.
Analyze
ANALYZE.
Reindex
REINDEX.
Fields
Explain
EXPLAIN or EXPLAIN QUERY PLAN.