Enum sqlite3_parser::ast::Stmt
source · pub enum Stmt {
Show 25 variants
AlterTable(QualifiedName, AlterTableBody),
Analyze(Option<QualifiedName>),
Attach {
expr: Expr,
db_name: Expr,
key: Option<Expr>,
},
Begin(Option<TransactionType>, Option<Name>),
Commit(Option<Name>),
CreateIndex {
unique: bool,
if_not_exists: bool,
idx_name: QualifiedName,
tbl_name: Name,
columns: Vec<SortedColumn>,
where_clause: Option<Expr>,
},
CreateTable {
temporary: bool,
if_not_exists: bool,
tbl_name: QualifiedName,
body: CreateTableBody,
},
CreateTrigger {
temporary: bool,
if_not_exists: bool,
trigger_name: QualifiedName,
time: Option<TriggerTime>,
event: TriggerEvent,
tbl_name: QualifiedName,
for_each_row: bool,
when_clause: Option<Expr>,
commands: Vec<TriggerCmd>,
},
CreateView {
temporary: bool,
if_not_exists: bool,
view_name: QualifiedName,
columns: Option<Vec<IndexedColumn>>,
select: Select,
},
CreateVirtualTable {
if_not_exists: bool,
tbl_name: QualifiedName,
module_name: Name,
args: Option<Vec<String>>,
},
Delete {
with: Option<With>,
tbl_name: QualifiedName,
indexed: Option<Indexed>,
where_clause: Option<Expr>,
returning: Option<Vec<ResultColumn>>,
order_by: Option<Vec<SortedColumn>>,
limit: Option<Limit>,
},
Detach(Expr),
DropIndex {
if_exists: bool,
idx_name: QualifiedName,
},
DropTable {
if_exists: bool,
tbl_name: QualifiedName,
},
DropTrigger {
if_exists: bool,
trigger_name: QualifiedName,
},
DropView {
if_exists: bool,
view_name: QualifiedName,
},
Insert {
with: Option<With>,
or_conflict: Option<ResolveType>,
tbl_name: QualifiedName,
columns: Option<DistinctNames>,
body: InsertBody,
returning: Option<Vec<ResultColumn>>,
},
Pragma(QualifiedName, Option<PragmaBody>),
Reindex {
obj_name: Option<QualifiedName>,
},
Release(Name),
Rollback {
tx_name: Option<Name>,
savepoint_name: Option<Name>,
},
Savepoint(Name),
Select(Select),
Update {
with: Option<With>,
or_conflict: Option<ResolveType>,
tbl_name: QualifiedName,
indexed: Option<Indexed>,
sets: Vec<Set>,
from: Option<FromClause>,
where_clause: Option<Expr>,
returning: Option<Vec<ResultColumn>>,
order_by: Option<Vec<SortedColumn>>,
limit: Option<Limit>,
},
Vacuum(Option<Name>, Option<Expr>),
}Expand description
SQL statement
Variants§
AlterTable(QualifiedName, AlterTableBody)
ALTER TABLE: table name, body
Analyze(Option<QualifiedName>)
ANALYSE: object name
Attach
ATTACH DATABASE
Begin(Option<TransactionType>, Option<Name>)
BEGIN: tx type, tx name
Commit(Option<Name>)
COMMIT/END: tx name
CreateIndex
CREATE INDEX
CreateTable
CREATE TABLE
CreateTrigger
CREATE TRIGGER
Fields
§
trigger_name: QualifiedNametrigger name
§
time: Option<TriggerTime>BEFORE/AFTER/INSTEAD OF
§
event: TriggerEventDELETE/INSERT/UPDATE
§
tbl_name: QualifiedNametable name
§
commands: Vec<TriggerCmd>statements
CreateView
CREATE VIEW
CreateVirtualTable
CREATE VIRTUAL TABLE
Fields
§
tbl_name: QualifiedNametable name
Delete
DELETE
Fields
§
tbl_name: QualifiedNameFROM table name
§
returning: Option<Vec<ResultColumn>>RETURNING
§
order_by: Option<Vec<SortedColumn>>ORDER BY
Detach(Expr)
DETACH DATABASE: db name
DropIndex
DROP INDEX
DropTable
DROP TABLE
DropTrigger
DROP TRIGGER
DropView
DROP VIEW
Insert
INSERT
Fields
§
or_conflict: Option<ResolveType>OR
§
tbl_name: QualifiedNametable name
§
columns: Option<DistinctNames>COLUMNS
§
body: InsertBodyVALUES or SELECT
§
returning: Option<Vec<ResultColumn>>RETURNING
Pragma(QualifiedName, Option<PragmaBody>)
PRAGMA: pragma name, body
Reindex
REINDEX
Fields
§
obj_name: Option<QualifiedName>collation or index or table name
Release(Name)
RELEASE: savepoint name
Rollback
ROLLBACK
Savepoint(Name)
SAVEPOINT: savepoint name
Select(Select)
SELECT
Update
UPDATE
Fields
§
or_conflict: Option<ResolveType>OR
§
tbl_name: QualifiedNametable name
§
from: Option<FromClause>FROM
§
returning: Option<Vec<ResultColumn>>RETURNING
§
order_by: Option<Vec<SortedColumn>>ORDER BY
Vacuum(Option<Name>, Option<Expr>)
VACUUM: database name, into expr
Implementations§
source§impl Stmt
impl Stmt
sourcepub fn column_count(&self) -> ColumnCount
pub fn column_count(&self) -> ColumnCount
Like sqlite3_column_count but more limited
sourcepub fn check(&self) -> Result<(), ParserError>
pub fn check(&self) -> Result<(), ParserError>
check for extra rules
Trait Implementations§
source§impl PartialEq for Stmt
impl PartialEq for Stmt
impl Eq for Stmt
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.