PostgresTransaction

Struct PostgresTransaction 

Source
pub struct PostgresTransaction<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> PostgresTransaction<'a>

Source

pub fn new(trx: Transaction<'a, Postgres>) -> Self

Source

pub async fn commit(self) -> Result<()>

Source

pub async fn rollback(self) -> Result<()>

Trait Implementations§

Source§

impl<'a> Debug for PostgresTransaction<'a>

Source§

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

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

impl<'t> SqlExecutorMut<Postgres> for PostgresTransaction<'t>

Source§

async fn execute<'a>( &'a mut self, stmt: &'a str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<u64>

Source§

async fn execute_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>

Source§

async fn fetch_count<'s, 'a>( &'a mut self, stmt: &'s str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<u64>
where 'a: 's,

Source§

async fn fetch_count_plain<'a>(&'a mut self, stmt: &'a str) -> Result<u64>

Source§

async fn fetch_exists<'a>( &'a mut self, stmt: &'a str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<bool>

Source§

async fn fetch_exists_plain<'a, A>(&'a mut self, stmt: &'a str) -> Result<bool>

Source§

async fn fetch_option<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_option_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_option_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_option_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all_plain<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all_plain_<'a, SE>( &'a mut self, stmt: &'a str, selection: &'a SE, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_one_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<SE>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_one_full_plain<'a, SE>(&'a mut self, stmt: &'a str) -> Result<SE>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_option_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_option_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Option<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all_full<'a, SE>( &'a mut self, stmt: &'a str, args: <Postgres as Database>::Arguments<'a>, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

async fn fetch_all_full_plain<'a, SE>( &'a mut self, stmt: &'a str, ) -> Result<Vec<SE>>
where SE: Selected<Postgres> + Send + Unpin,

Source§

impl<'t> SqlGenericExecutor for PostgresTransaction<'t>

Source§

type DB = Postgres

Source§

type CountType = CountResult

Source§

fn get_affected_rows(query_result: &<Self::DB as Database>::QueryResult) -> u64

Source§

async fn generic_exists<'a, EX, A>( ex: EX, stmt: &'a str, args: A, ) -> Result<bool>
where EX: Executor<'a, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_exists_plain<'a, EX, A>( ex: EX, stmt: &'a str, _args: PhantomData<A>, ) -> Result<bool>
where EX: Executor<'a, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_count<'s, 'a, EX, A>( ex: EX, stmt: &'s str, args: A, ) -> Result<Self::CountType>
where EX: Executor<'a, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a, 's: 'a,

Source§

async fn generic_count_plain<'a, EX, A>( ex: EX, stmt: &'a str, _args: PhantomData<A>, ) -> Result<Self::CountType>
where EX: Executor<'a, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_execute<'a, 'e, EX, A>( ex: EX, query: &'a str, args: A, ) -> Result<u64>
where EX: Executor<'e, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_execute_plain<'a, EX, A>( ex: EX, query: &'a str, _args: PhantomData<A>, ) -> Result<u64>
where EX: Executor<'a, Database = Self::DB>, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_all<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_all_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_all_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_all_plain_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_one<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_fetch_one_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_fetch_one_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_one_plain_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_option<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_option_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, args: A, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_option_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_option_plain_<'a, EX, SE, A>( ex: EX, stmt: &'a str, selection: &SE, _: PhantomData<A>, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_all_full<'a, EX, SE, A>( ex: EX, stmt: &'a str, args: A, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_fetch_all_full_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, _: PhantomData<A>, ) -> Result<Vec<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_one_full<'a, EX, SE, A>( ex: EX, stmt: &'a str, args: A, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_fetch_one_full_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, _: PhantomData<A>, ) -> Result<SE>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Source§

async fn generic_fetch_option_full<'a, EX, SE, A>( ex: EX, stmt: &'a str, args: A, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a,

Source§

async fn generic_fetch_option_full_plain<'a, EX, SE, A>( ex: EX, stmt: &'a str, _: PhantomData<A>, ) -> Result<Option<SE>>
where EX: Executor<'a, Database = Self::DB>, SE: Selected<Self::DB> + Send + Unpin, A: IntoArguments<'a, Self::DB> + 'a + Default,

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ReaderMutApi for T

Source§

async fn select<SE, M>( &mut self, selection: &SE, unique: &dyn PostgresUnique<Mutation = M>, ) -> Result<Option<SE>>

Source§

async fn search<SE>( &mut self, selection: &SE, location: &dyn PostgresLocation, order_by: &dyn OrderBy, page: &Pagination, ) -> Result<Vec<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn search_all<SE>( &mut self, selection: &SE, location: &dyn PostgresLocation, order_by: &dyn OrderBy, ) -> Result<Vec<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn search_paged<SE>( &mut self, selection: &SE, location: &dyn PostgresLocation, order_by: &dyn OrderBy, page: &Pagination, ) -> Result<PagedList<Postgres, SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn exists<M: PostgresMutation>( &mut self, unique: &dyn PostgresUnique<Mutation = M>, ) -> Result<bool>

Source§

async fn count(&mut self, location: &dyn PostgresLocation) -> Result<u64>

Source§

async fn select_full<SE, M>( &mut self, unique: &dyn PostgresUnique<Mutation = M>, ) -> Result<Option<SE>>

Source§

async fn search_full<SE>( &mut self, location: &dyn PostgresLocation, order_by: &dyn OrderBy, page: &Pagination, ) -> Result<Vec<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn search_full_all<SE>( &mut self, location: &dyn PostgresLocation, order_by: &dyn OrderBy, ) -> Result<Vec<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn search_full_paged<SE>( &mut self, location: &dyn PostgresLocation, order_by: &dyn OrderBy, page: &Pagination, ) -> Result<PagedList<Postgres, SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TemplateMutApi for T

Source§

async fn execute_by_template( &mut self, template: &dyn PostgresTemplate, ) -> Result<u64>

Source§

async fn fetch_one_by_template<SE>( &mut self, template: &dyn PostgresTemplate, ) -> Result<SE>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn fetch_option_by_template<SE>( &mut self, template: &dyn PostgresTemplate, ) -> Result<Option<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn fetch_all_by_template<SE>( &mut self, template: &dyn PostgresTemplate, ) -> Result<Vec<SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

async fn fetch_paged_by_template<SE>( &mut self, template: &dyn PostgresTemplate, page: &Pagination, ) -> Result<PagedList<Postgres, SE>>
where SE: PostgresSelected + Send + Unpin,

Source§

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

Source§

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

Source§

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

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

Source§

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

impl<T> WriterMutApi for T

Source§

async fn insert(&mut self, entity: &dyn PostgresEntity) -> Result<()>

Source§

async fn upsert(&mut self, entity: &dyn PostgresEntity) -> Result<()>

Source§

async fn create(&mut self, entity: &mut dyn PostgresEntity) -> Result<()>

Source§

async fn update<M: PostgresMutation>( &mut self, mutation: &M, unique: &dyn PostgresUnique<Mutation = M>, ) -> Result<bool>

Source§

async fn change( &mut self, mutation: &dyn PostgresMutation, location: &dyn PostgresLocation, ) -> Result<u64>

Source§

async fn delete<M: PostgresMutation>( &mut self, unique: &dyn PostgresUnique<Mutation = M>, ) -> Result<bool>

Source§

async fn purify(&mut self, location: &dyn PostgresLocation) -> Result<u64>