Skip to main content

Stmt

Enum Stmt 

Source
pub enum Stmt<'bump> {
Show 25 variants AlterTable(QualifiedName<'bump>, AlterTableBody<'bump>), Analyze(Option<QualifiedName<'bump>>), Attach { expr: Expr<'bump>, db_name: Expr<'bump>, key: Option<Expr<'bump>>, }, Begin(Option<TransactionType>, Option<Name<'bump>>), Commit(Option<Name<'bump>>), CreateIndex { unique: bool, if_not_exists: bool, idx_name: QualifiedName<'bump>, tbl_name: Name<'bump>, columns: &'bump [SortedColumn<'bump>], where_clause: Option<Expr<'bump>>, }, CreateTable { temporary: bool, if_not_exists: bool, tbl_name: QualifiedName<'bump>, body: CreateTableBody<'bump>, }, CreateTrigger { temporary: bool, if_not_exists: bool, trigger_name: QualifiedName<'bump>, time: Option<TriggerTime>, event: TriggerEvent<'bump>, tbl_name: QualifiedName<'bump>, for_each_row: bool, when_clause: Option<Expr<'bump>>, commands: &'bump [TriggerCmd<'bump>], }, CreateView { temporary: bool, if_not_exists: bool, view_name: QualifiedName<'bump>, columns: Option<&'bump [IndexedColumn<'bump>]>, select: &'bump Select<'bump>, }, CreateVirtualTable { if_not_exists: bool, tbl_name: QualifiedName<'bump>, module_name: Name<'bump>, args: Option<&'bump [&'bump str]>, }, Delete { with: Option<With<'bump>>, tbl_name: QualifiedName<'bump>, indexed: Option<Indexed<'bump>>, where_clause: Option<Expr<'bump>>, returning: Option<&'bump [ResultColumn<'bump>]>, order_by: Option<&'bump [SortedColumn<'bump>]>, limit: Option<&'bump Limit<'bump>>, }, Detach(Expr<'bump>), DropIndex { if_exists: bool, idx_name: QualifiedName<'bump>, }, DropTable { if_exists: bool, tbl_name: QualifiedName<'bump>, }, DropTrigger { if_exists: bool, trigger_name: QualifiedName<'bump>, }, DropView { if_exists: bool, view_name: QualifiedName<'bump>, }, Insert { with: Option<With<'bump>>, or_conflict: Option<ResolveType>, tbl_name: QualifiedName<'bump>, columns: Option<DistinctNames<'bump>>, body: InsertBody<'bump>, returning: Option<&'bump [ResultColumn<'bump>]>, }, Pragma(QualifiedName<'bump>, Option<PragmaBody<'bump>>), Reindex { obj_name: Option<QualifiedName<'bump>>, }, Release(Name<'bump>), Rollback { tx_name: Option<Name<'bump>>, savepoint_name: Option<Name<'bump>>, }, Savepoint(Name<'bump>), Select(&'bump Select<'bump>), Update { with: Option<With<'bump>>, or_conflict: Option<ResolveType>, tbl_name: QualifiedName<'bump>, indexed: Option<Indexed<'bump>>, sets: &'bump [Set<'bump>], from: Option<FromClause<'bump>>, where_clause: Option<Expr<'bump>>, returning: Option<&'bump [ResultColumn<'bump>]>, order_by: Option<&'bump [SortedColumn<'bump>]>, limit: Option<&'bump Limit<'bump>>, }, Vacuum(Option<Name<'bump>>, Option<Expr<'bump>>),
}
Expand description

SQL statement

Variants§

§

AlterTable(QualifiedName<'bump>, AlterTableBody<'bump>)

ALTER TABLE: table name, body

§

Analyze(Option<QualifiedName<'bump>>)

ANALYSE: object name

§

Attach

ATTACH DATABASE

Fields

§expr: Expr<'bump>

filename

§db_name: Expr<'bump>

schema name

§key: Option<Expr<'bump>>

password

§

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

BEGIN: tx type, tx name

§

Commit(Option<Name<'bump>>)

COMMIT/END: tx name

§

CreateIndex

CREATE INDEX

Fields

§unique: bool

UNIQUE

§if_not_exists: bool

IF NOT EXISTS

§idx_name: QualifiedName<'bump>

index name

§tbl_name: Name<'bump>

table name

§columns: &'bump [SortedColumn<'bump>]

indexed columns or expressions

§where_clause: Option<Expr<'bump>>

partial index

§

CreateTable

CREATE TABLE

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§tbl_name: QualifiedName<'bump>

table name

§body: CreateTableBody<'bump>

table body

§

CreateTrigger

CREATE TRIGGER

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§trigger_name: QualifiedName<'bump>

trigger name

§time: Option<TriggerTime>

BEFORE/AFTER/INSTEAD OF

§event: TriggerEvent<'bump>

DELETE/INSERT/UPDATE

§tbl_name: QualifiedName<'bump>

table name

§for_each_row: bool

FOR EACH ROW

§when_clause: Option<Expr<'bump>>

WHEN

§commands: &'bump [TriggerCmd<'bump>]

statements

§

CreateView

CREATE VIEW

Fields

§temporary: bool

TEMPORARY

§if_not_exists: bool

IF NOT EXISTS

§view_name: QualifiedName<'bump>

view name

§columns: Option<&'bump [IndexedColumn<'bump>]>

columns

§select: &'bump Select<'bump>

query

§

CreateVirtualTable

CREATE VIRTUAL TABLE

Fields

§if_not_exists: bool

IF NOT EXISTS

§tbl_name: QualifiedName<'bump>

table name

§module_name: Name<'bump>

module

§args: Option<&'bump [&'bump str]>

args

§

Delete

DELETE

Fields

§with: Option<With<'bump>>

CTE

§tbl_name: QualifiedName<'bump>

FROM table name

§indexed: Option<Indexed<'bump>>

INDEXED

§where_clause: Option<Expr<'bump>>

WHERE clause

§returning: Option<&'bump [ResultColumn<'bump>]>

RETURNING

§order_by: Option<&'bump [SortedColumn<'bump>]>

ORDER BY

§limit: Option<&'bump Limit<'bump>>

LIMIT

§

Detach(Expr<'bump>)

DETACH DATABASE: db name

§

DropIndex

DROP INDEX

Fields

§if_exists: bool

IF EXISTS

§idx_name: QualifiedName<'bump>

index name

§

DropTable

DROP TABLE

Fields

§if_exists: bool

IF EXISTS

§tbl_name: QualifiedName<'bump>

table name

§

DropTrigger

DROP TRIGGER

Fields

§if_exists: bool

IF EXISTS

§trigger_name: QualifiedName<'bump>

trigger name

§

DropView

DROP VIEW

Fields

§if_exists: bool

IF EXISTS

§view_name: QualifiedName<'bump>

view name

§

Insert

INSERT

Fields

§with: Option<With<'bump>>

CTE

§or_conflict: Option<ResolveType>

OR

§tbl_name: QualifiedName<'bump>

table name

§columns: Option<DistinctNames<'bump>>

COLUMNS

§body: InsertBody<'bump>

VALUES or SELECT

§returning: Option<&'bump [ResultColumn<'bump>]>

RETURNING

§

Pragma(QualifiedName<'bump>, Option<PragmaBody<'bump>>)

PRAGMA: pragma name, body

§

Reindex

REINDEX

Fields

§obj_name: Option<QualifiedName<'bump>>

collation or index or table name

§

Release(Name<'bump>)

RELEASE: savepoint name

§

Rollback

ROLLBACK

Fields

§tx_name: Option<Name<'bump>>

transaction name

§savepoint_name: Option<Name<'bump>>

savepoint name

§

Savepoint(Name<'bump>)

SAVEPOINT: savepoint name

§

Select(&'bump Select<'bump>)

SELECT

§

Update

UPDATE

Fields

§with: Option<With<'bump>>

CTE

§or_conflict: Option<ResolveType>

OR

§tbl_name: QualifiedName<'bump>

table name

§indexed: Option<Indexed<'bump>>

INDEXED

§sets: &'bump [Set<'bump>]

SET assignments

§from: Option<FromClause<'bump>>

FROM

§where_clause: Option<Expr<'bump>>

WHERE clause

§returning: Option<&'bump [ResultColumn<'bump>]>

RETURNING

§order_by: Option<&'bump [SortedColumn<'bump>]>

ORDER BY

§limit: Option<&'bump Limit<'bump>>

LIMIT

§

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

VACUUM: database name, into expr

Implementations§

Source§

impl<'bump> Stmt<'bump>

Source

pub fn create_index( unique: bool, if_not_exists: bool, idx_name: QualifiedName<'bump>, tbl_name: Name<'bump>, columns: Vec<'bump, SortedColumn<'bump>>, where_clause: Option<Expr<'bump>>, ) -> Result<Self, ParserError>

CREATE INDEX constructor

Source

pub fn update( with: Option<With<'bump>>, or_conflict: Option<ResolveType>, tbl_name: QualifiedName<'bump>, indexed: Option<Indexed<'bump>>, sets: Vec<'bump, Set<'bump>>, from: Option<FromClause<'bump>>, where_clause: Option<Expr<'bump>>, returning: Option<Vec<'bump, ResultColumn<'bump>>>, order_by: Option<Vec<'bump, SortedColumn<'bump>>>, limit: Option<&'bump Limit<'bump>>, ) -> Result<Self, ParserError>

UPDATE constructor

Trait Implementations§

Source§

impl<'bump> Debug for Stmt<'bump>

Source§

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

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

impl<'bump> Eq for Stmt<'bump>

Source§

impl<'bump> PartialEq for Stmt<'bump>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'bump> StructuralPartialEq for Stmt<'bump>

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

Auto Trait Implementations§

§

impl<'bump> !RefUnwindSafe for Stmt<'bump>

§

impl<'bump> !Send for Stmt<'bump>

§

impl<'bump> !Sync for Stmt<'bump>

§

impl<'bump> !UnwindSafe for Stmt<'bump>

§

impl<'bump> Freeze for Stmt<'bump>

§

impl<'bump> Unpin for Stmt<'bump>

§

impl<'bump> UnsafeUnpin for Stmt<'bump>

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.