pub struct MigrationContext<'connection> { /* private fields */ }Expand description
Host SQL inside one schema-migration transaction.
The database retains the connection and transaction boundary; migration code can transform the host schema without opening, retaining, or passing a SQLite connection.
Implementations§
Source§impl MigrationContext<'_>
impl MigrationContext<'_>
pub fn execute<P>(&self, sql: &str, params: P) -> Result<usize>where
P: Params,
pub fn execute_batch(&self, sql: &str) -> Result<()>
pub fn query_row<T, P, F>(&self, sql: &str, params: P, map: F) -> Result<T>where
P: Params,
F: FnOnce(&Row<'_>) -> Result<T>,
pub fn query<T, P, F>(&self, sql: &str, params: P, map: F) -> Result<Vec<T>>where
P: Params,
F: FnMut(&Row<'_>) -> Result<T>,
Auto Trait Implementations§
impl<'connection> Freeze for MigrationContext<'connection>
impl<'connection> !RefUnwindSafe for MigrationContext<'connection>
impl<'connection> !Send for MigrationContext<'connection>
impl<'connection> !Sync for MigrationContext<'connection>
impl<'connection> Unpin for MigrationContext<'connection>
impl<'connection> UnsafeUnpin for MigrationContext<'connection>
impl<'connection> !UnwindSafe for MigrationContext<'connection>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more