Skip to main content

SchemaPragma

Trait SchemaPragma 

Source
pub trait SchemaPragma: Pragma<Scope = PerSchema> {
    // Provided methods
    fn get<Row>(
        schema: Option<&str>,
        conn: &mut SqliteConnection,
    ) -> QueryResult<Row>
       where Self: ReadPragma,
             Sqlite: QueryMetadata<Self::SqlType>,
             Row: FromSqlRow<Self::SqlType, Sqlite> { ... }
    fn get_all<Row>(
        schema: Option<&str>,
        conn: &mut SqliteConnection,
    ) -> QueryResult<Vec<Row>>
       where Self: ReadPragma,
             Sqlite: QueryMetadata<Self::SqlType>,
             Row: FromSqlRow<Self::SqlType, Sqlite> { ... }
    fn set<'a>(
        argument: impl Into<Self::Argument<'a>>,
        schema: Option<&str>,
        conn: &mut SqliteConnection,
    ) -> QueryResult<()>
       where Self: WritePragma { ... }
}
Available on crate feature __sqlite-shared only.
Expand description

Reads and writes a PerSchema pragma, where a None schema selects main.

Provided Methods§

Source

fn get<Row>( schema: Option<&str>, conn: &mut SqliteConnection, ) -> QueryResult<Row>
where Self: ReadPragma, Sqlite: QueryMetadata<Self::SqlType>, Row: FromSqlRow<Self::SqlType, Sqlite>,

Read the first row, returning Error::NotFound if the pragma returns none.

Source

fn get_all<Row>( schema: Option<&str>, conn: &mut SqliteConnection, ) -> QueryResult<Vec<Row>>
where Self: ReadPragma, Sqlite: QueryMetadata<Self::SqlType>, Row: FromSqlRow<Self::SqlType, Sqlite>,

Read every row.

Source

fn set<'a>( argument: impl Into<Self::Argument<'a>>, schema: Option<&str>, conn: &mut SqliteConnection, ) -> QueryResult<()>
where Self: WritePragma,

Assign argument, running the statement to completion without confirming the value SQLite applied.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P: Pragma<Scope = PerSchema>> SchemaPragma for P