pub struct MigrationContext<Db>where
    Db: Database,{ /* private fields */ }

Implementations§

source§

impl<Db> MigrationContext<Db>where Db: Database,

source

pub fn tx(&mut self) -> &mut Self

Return an executor that can execute queries.

Currently this just re-borrows self.

source

pub fn get<T: Any>(&self) -> Option<&T>

Get an extension.

Trait Implementations§

source§

impl<Db> Debug for MigrationContext<Db>where Db: Database + Debug,

source§

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

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

impl<'c> Executor<'c> for &'c mut MigrationContext<Postgres>

§

type Database = Postgres

source§

fn fetch_many<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<Either<<Self::Database as Database>::QueryResult, <Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute multiple queries and return the generated results as a stream from each query, in a stream.
source§

fn fetch_optional<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and returns at most one row.
source§

fn prepare_with<'e, 'q: 'e>( self, sql: &'q str, parameters: &'e [<Self::Database as Database>::TypeInfo] ) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, Error>>where 'c: 'e,

Prepare the SQL query, with parameter type information, to inspect the type information about its parameters and results. Read more
source§

fn execute<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<<Self::Database as Database>::QueryResult, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return the total number of rows affected.
source§

fn execute_many<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<<Self::Database as Database>::QueryResult, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute multiple queries and return the rows affected from each query, in a stream.
source§

fn fetch<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<<Self::Database as Database>::Row, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return the generated results as a stream.
source§

fn fetch_all<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<Vec<<Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return all the generated results, collected into a Vec.
source§

fn fetch_one<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<<Self::Database as Database>::Row, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and returns exactly one row.
source§

fn prepare<'e, 'q: 'e>( self, query: &'q str ) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, Error>>where 'c: 'e,

Prepare the SQL query to inspect the type information of its parameters and results. Read more
source§

impl<'c> Executor<'c> for &'c mut MigrationContext<Sqlite>

§

type Database = Sqlite

source§

fn fetch_many<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<Either<<Self::Database as Database>::QueryResult, <Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute multiple queries and return the generated results as a stream from each query, in a stream.
source§

fn fetch_optional<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and returns at most one row.
source§

fn prepare_with<'e, 'q: 'e>( self, sql: &'q str, parameters: &'e [<Self::Database as Database>::TypeInfo] ) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, Error>>where 'c: 'e,

Prepare the SQL query, with parameter type information, to inspect the type information about its parameters and results. Read more
source§

fn execute<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<<Self::Database as Database>::QueryResult, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return the total number of rows affected.
source§

fn execute_many<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<<Self::Database as Database>::QueryResult, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute multiple queries and return the rows affected from each query, in a stream.
source§

fn fetch<'e, 'q: 'e, E>( self, query: E ) -> BoxStream<'e, Result<<Self::Database as Database>::Row, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return the generated results as a stream.
source§

fn fetch_all<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<Vec<<Self::Database as Database>::Row>, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and return all the generated results, collected into a Vec.
source§

fn fetch_one<'e, 'q: 'e, E>( self, query: E ) -> BoxFuture<'e, Result<<Self::Database as Database>::Row, Error>>where E: Execute<'q, Self::Database> + 'q, 'c: 'e,

Execute the query and returns exactly one row.
source§

fn prepare<'e, 'q: 'e>( self, query: &'q str ) -> BoxFuture<'e, Result<<Self::Database as HasStatement<'q>>::Statement, Error>>where 'c: 'e,

Prepare the SQL query to inspect the type information of its parameters and results. Read more

Auto Trait Implementations§

§

impl<Db> !RefUnwindSafe for MigrationContext<Db>

§

impl<Db> Send for MigrationContext<Db>

§

impl<Db> Sync for MigrationContext<Db>where <Db as Database>::Connection: Sync,

§

impl<Db> Unpin for MigrationContext<Db>where <Db as Database>::Connection: Unpin,

§

impl<Db> !UnwindSafe for MigrationContext<Db>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more