pub enum Statement {
Show 16 variants
AddColumn(AddColumn),
AlterColumn(AlterColumn),
AlterTable(AlterTable),
AlterType(AlterType),
CopyTable(CopyTable),
CreateIndex(CreateIndex),
CreateTable(CreateTable),
CreateType(CreateType),
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).
AlterType(AlterType)
Alter a type (e.g. ALTER TYPE ... ADD VALUE '...').
CopyTable(CopyTable)
Copy rows from one table to another.
CreateIndex(CreateIndex)
Create an index.
CreateTable(CreateTable)
Create a table.
CreateType(CreateType)
Create a type (e.g. CREATE TYPE ... AS ENUM (...)).
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 alter_type_add_value(type_name: &str, variant: &EnumVariant) -> Self
pub fn alter_type_add_value(type_name: &str, variant: &EnumVariant) -> Self
Creates an ALTER TYPE <name> ADD VALUE '<variant>' statement.
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 create_enum_type(ty: &TypeEnum) -> Self
pub fn create_enum_type(ty: &TypeEnum) -> Self
Creates a CREATE TYPE ... AS ENUM (...) statement from a [TypeEnum].
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.