pub enum Statement {
Show 14 variants
AddColumn(AddColumn),
AlterColumn(AlterColumn),
AlterTable(AlterTable),
CopyTable(CopyTable),
CreateIndex(CreateIndex),
CreateTable(CreateTable),
DropColumn(DropColumn),
DropTable(DropTable),
DropIndex(DropIndex),
Pragma(Pragma),
Delete(Delete),
Insert(Insert),
Query(Query),
Update(Update),
}Expand description
A SQL statement, covering both DDL (schema changes) and DML (data manipulation).
Variants§
AddColumn(AddColumn)
Add a column to an existing table.
AlterColumn(AlterColumn)
Alter properties of an existing column.
AlterTable(AlterTable)
Alter an existing table (e.g. rename).
CopyTable(CopyTable)
Copy rows from one table to another.
CreateIndex(CreateIndex)
Create an index.
CreateTable(CreateTable)
Create a table.
DropColumn(DropColumn)
Drop a column from an existing table.
DropTable(DropTable)
Drop a table.
DropIndex(DropIndex)
Drop an index.
Pragma(Pragma)
A SQLite PRAGMA statement.
Delete(Delete)
A DELETE statement.
Insert(Insert)
An INSERT statement.
Query(Query)
A SELECT query.
Update(Update)
An UPDATE statement.
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn add_column(column: &Column, capability: &Capability) -> Self
pub fn add_column(column: &Column, capability: &Capability) -> Self
Adds a column to a table.
Source§impl Statement
impl Statement
Sourcepub fn alter_column(
column: &Column,
changes: AlterColumnChanges,
capability: &Capability,
) -> Self
pub fn alter_column( column: &Column, changes: AlterColumnChanges, capability: &Capability, ) -> Self
Alters a column.
Source§impl Statement
impl Statement
Sourcepub fn alter_table_rename_to(table: &Table, new_name: &str) -> Self
pub fn alter_table_rename_to(table: &Table, new_name: &str) -> Self
Renames a table.
Source§impl Statement
impl Statement
Sourcepub fn create_index(index: &Index) -> Self
pub fn create_index(index: &Index) -> Self
Creates a CREATE INDEX statement from a schema [Index].
Source§impl Statement
impl Statement
Sourcepub fn create_table(table: &Table, capability: &Capability) -> Self
pub fn create_table(table: &Table, capability: &Capability) -> Self
Creates a CREATE TABLE statement from a schema [Table].
Source§impl Statement
impl Statement
Sourcepub fn drop_column(column: &Column) -> Self
pub fn drop_column(column: &Column) -> Self
Drops a column from a table.
This function does not add an IF EXISTS clause.
Sourcepub fn drop_column_if_exists(column: &Column) -> Self
pub fn drop_column_if_exists(column: &Column) -> Self
Drops a column from a table if it exists.
This function does add an IF EXISTS clause.
Source§impl Statement
impl Statement
Sourcepub fn drop_index(index: &Index) -> Self
pub fn drop_index(index: &Index) -> Self
Drops an index.
This function does not add an IF EXISTS clause.
Sourcepub fn drop_index_if_exists(index: &Index) -> Self
pub fn drop_index_if_exists(index: &Index) -> Self
Drops a index if it exists.
This function does add an IF EXISTS clause.
Source§impl Statement
impl Statement
Sourcepub fn drop_table(table: &Table) -> Self
pub fn drop_table(table: &Table) -> Self
Drops a table.
This function does not add an IF EXISTS clause.
Sourcepub fn drop_table_if_exists(table: &Table) -> Self
pub fn drop_table_if_exists(table: &Table) -> Self
Drops a table if it exists.
This function does add an IF EXISTS clause.
Source§impl Statement
impl Statement
Sourcepub fn pragma_enable_foreign_keys() -> Self
pub fn pragma_enable_foreign_keys() -> Self
Sets PRAGMA foreign_keys = ON.
Sourcepub fn pragma_disable_foreign_keys() -> Self
pub fn pragma_disable_foreign_keys() -> Self
Sets PRAGMA foreign_keys = OFF.