pub enum Directive {
Show 19 variants
Begin(BeginKind),
Commit,
Rollback {
savepoint: Option<Vec<u8>>,
},
Savepoint(Vec<u8>),
Release(Vec<u8>),
CreateTable {
if_not_exists: bool,
database: usize,
name: Vec<u8>,
name_offset: u32,
exists: bool,
},
CreateTableAsSelect {
if_not_exists: bool,
database: usize,
name: Vec<u8>,
exists: bool,
create_sql: Vec<u8>,
select_sql: Vec<u8>,
},
CreateVirtualTable {
if_not_exists: bool,
database: usize,
name: Vec<u8>,
module: Vec<u8>,
arguments: Vec<Vec<u8>>,
name_offset: u32,
exists: bool,
},
Alter {
database: usize,
table: Vec<u8>,
action: AlterKind,
},
Reindex {
database: usize,
indexes: Vec<Vec<u8>>,
},
Vacuum {
database: usize,
into: Option<Vec<u8>>,
},
Attach {
file: Vec<u8>,
schema: Vec<u8>,
},
Detach {
schema: Vec<u8>,
},
Analyze {
database: usize,
table: Option<Vec<u8>>,
every_schema: bool,
},
CreateView {
if_not_exists: bool,
database: usize,
name: Vec<u8>,
name_offset: u32,
exists: bool,
},
CreateTrigger {
database: usize,
name: Vec<u8>,
name_offset: u32,
table: Vec<u8>,
exists: bool,
},
CreateIndex {
unique: bool,
if_not_exists: bool,
database: usize,
name: Vec<u8>,
name_offset: u32,
table: Vec<u8>,
table_root: u32,
using: Option<Vec<u8>>,
columns: Vec<IndexKeyColumn>,
settings: Vec<(Vec<u8>, Vec<u8>)>,
exists: bool,
},
Drop {
kind: ObjectKind,
if_exists: bool,
database: usize,
name: Vec<u8>,
root: u32,
index_roots: Vec<u32>,
exists: bool,
},
Pragma {
database: Option<usize>,
name: Vec<u8>,
argument: Option<PragmaArgument>,
},
}Expand description
A statement the session carries out.
Variants§
Begin(BeginKind)
BEGIN.
Commit
COMMIT or END.
Rollback
ROLLBACK, or ROLLBACK TO savepoint.
Savepoint(Vec<u8>)
SAVEPOINT name.
Release(Vec<u8>)
RELEASE name.
CreateTable
CREATE TABLE.
Fields
CreateTableAsSelect
CREATE TABLE ... AS SELECT.
A CREATE whose column list comes from a plan, which is why it is a
directive of its own rather than a flag on the one above: everything
about the table - its column names, and the declared types it inherits
from the query’s origin columns - is decided by binding the query, and
the CREATE text that is stored is synthesised rather than being a
slice of what was typed.
Fields
select_sql: Vec<u8>The SELECT that fills it, as the source text it was written as.
The text rather than the bound query, because the rows are inserted
by an ordinary INSERT INTO name <select> compiled against the
schema after the table exists - which is one implementation of
what an insert means rather than a second one written here.
CreateVirtualTable
CREATE VIRTUAL TABLE.
Fields
Alter
ALTER TABLE.
Fields
Reindex
REINDEX, over one index, one table’s indexes, or everything.
Fields
Vacuum
VACUUM, which rebuilds the database into a fresh file.
Fields
Attach
ATTACH, which adds a database file to this connection.
Fields
Detach
DETACH, which removes one.
Analyze
ANALYZE, over one object or the whole schema.
Fields
CreateView
CREATE VIEW.
Fields
CreateTrigger
CREATE TRIGGER.
Fields
CreateIndex
CREATE INDEX.
Fields
columns: Vec<IndexKeyColumn>The key columns.
Drop
DROP TABLE or DROP INDEX.
Fields
kind: ObjectKindWhich kind of object.
Pragma
PRAGMA.
Fields
database: Option<usize>The schema the pragma was qualified with, when one was written.
PRAGMA aux.table_info(t) asks about the attached database rather
than about main, and a pragma that dropped the qualifier would
answer confidently about the wrong file.
argument: Option<PragmaArgument>The argument, when one was written.