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

Fields

§expr: Expr

filename

§db_name: Expr

schema name

§key: Option<Expr>

password

§

Begin(Option<TransactionType>, Option<Name>)

BEGIN: tx type, tx name

§

Commit(Option<Name>)

COMMIT/END: tx name

§

CreateIndex

CREATE INDEX

Fields

§unique: bool

UNIQUE

§if_not_exists: bool

IF NOT EXISTS

§idx_name: QualifiedName

index name

§tbl_name: Name

table name

§columns: Vec<SortedColumn>

indexed columns or expressions

§where_clause: Option<Expr>

partial index

§

CreateTable

CREATE TABLE

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§tbl_name: QualifiedName

table name

§body: CreateTableBody

table body

§

CreateTrigger

CREATE TRIGGER

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§trigger_name: QualifiedName

trigger name

§time: Option<TriggerTime>

BEFORE/AFTER/INSTEAD OF

§event: TriggerEvent

DELETE/INSERT/UPDATE

§tbl_name: QualifiedName

table name

§for_each_row: bool

FOR EACH ROW

§when_clause: Option<Expr>

WHEN

§commands: Vec<TriggerCmd>

statements

§

CreateView

CREATE VIEW

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§view_name: QualifiedName

view name

§columns: Option<Vec<IndexedColumn>>

columns

§select: Select

query

§

CreateVirtualTable

CREATE VIRTUAL TABLE

Fields

§if_not_exists: bool

IF NOT EXISTS

§tbl_name: QualifiedName

table name

§module_name: Name

module

§args: Option<Vec<String>>

args

§

Delete

DELETE

Fields

§with: Option<With>

CTE

§tbl_name: QualifiedName

FROM table name

§indexed: Option<Indexed>

INDEXED

§where_clause: Option<Expr>

WHERE clause

§returning: Option<Vec<ResultColumn>>

RETURNING

§order_by: Option<Vec<SortedColumn>>

ORDER BY

§limit: Option<Limit>

LIMIT

§

Detach(Expr)

DETACH DATABASE: db name

§

DropIndex

DROP INDEX

Fields

§if_exists: bool

IF EXISTS

§idx_name: QualifiedName

index name

§

DropTable

DROP TABLE

Fields

§if_exists: bool

IF EXISTS

§tbl_name: QualifiedName

table name

§

DropTrigger

DROP TRIGGER

Fields

§if_exists: bool

IF EXISTS

§trigger_name: QualifiedName

trigger name

§

DropView

DROP VIEW

Fields

§if_exists: bool

IF EXISTS

§view_name: QualifiedName

view name

§

Insert

INSERT

Fields

§with: Option<With>

CTE

§or_conflict: Option<ResolveType>

OR

§tbl_name: QualifiedName

table name

§columns: Option<DistinctNames>

COLUMNS

§body: InsertBody

VALUES 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

Fields

§tx_name: Option<Name>

transaction name

§savepoint_name: Option<Name>

savepoint name

§

Savepoint(Name)

SAVEPOINT: savepoint name

§

Select(Select)

SELECT

§

Update

UPDATE

Fields

§with: Option<With>

CTE

§or_conflict: Option<ResolveType>

OR

§tbl_name: QualifiedName

table name

§indexed: Option<Indexed>

INDEXED

§sets: Vec<Set>

SET assigments

§from: Option<FromClause>

FROM

§where_clause: Option<Expr>

WHERE clause

§returning: Option<Vec<ResultColumn>>

RETURNING

§order_by: Option<Vec<SortedColumn>>

ORDER BY

§limit: Option<Limit>

LIMIT

§

Vacuum(Option<Name>, Option<Expr>)

VACUUM: database name, into expr

Implementations§

source§

impl Stmt

source

pub fn column_count(&self) -> ColumnCount

Like sqlite3_column_count but more limited

source

pub fn readonly(&self) -> bool

Like sqlite3_stmt_readonly

source

pub fn check(&self) -> Result<(), ParserError>

check for extra rules

Trait Implementations§

source§

impl Clone for Stmt

source§

fn clone(&self) -> Stmt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Stmt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Stmt

source§

fn eq(&self, other: &Stmt) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToTokens for Stmt

source§

fn to_tokens<S: TokenStream>(&self, s: &mut S) -> Result<(), S::Error>

Send token(s) to the specified stream
source§

fn to_fmt(&self, f: &mut Formatter<'_>) -> Result

Format AST node
source§

impl Eq for Stmt

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.