pub struct VitrailClient { /* private fields */ }Expand description
Postgres client entry point.
Implementations§
Source§impl VitrailClient
impl VitrailClient
pub async fn new(database_url: &str) -> Result<VitrailClient, Error>
pub async fn with_options( options: PoolOptions<Postgres>, database_url: &str, ) -> Result<VitrailClient, Error>
Sourcepub async fn begin(&self) -> Result<VitrailTransaction, Error>
pub async fn begin(&self) -> Result<VitrailTransaction, Error>
Starts a new transaction using the database default isolation level.
The returned VitrailTransaction is an explicit transaction handle that
can be passed through service layers and used with the same core query and
write operations as VitrailClient.
Sourcepub async fn begin_with_options(
&self,
options: TransactionOptions,
) -> Result<VitrailTransaction, Error>
pub async fn begin_with_options( &self, options: TransactionOptions, ) -> Result<VitrailTransaction, Error>
Starts a new transaction with explicit transaction options.
This is the entry point for configuring transaction startup behavior such as the isolation level.
pub async fn find_many<Q>(
&self,
query: Q,
) -> Result<Vec<<Q as QuerySpec>::Output>, Error>where
Q: QuerySpec,
pub async fn find_optional<Q>(
&self,
query: Q,
) -> Result<Option<<Q as QuerySpec>::Output>, Error>where
Q: QuerySpec,
pub async fn find_first<Q>(
&self,
query: Q,
) -> Result<<Q as QuerySpec>::Output, Error>where
Q: QuerySpec,
pub async fn insert<I>(
&self,
insert: I,
) -> Result<<I as InsertSpec>::Output, Error>where
I: InsertSpec,
pub async fn update_many<U>(
&self,
update: U,
) -> Result<<U as UpdateSpec>::Output, Error>where
U: UpdateSpec,
pub async fn delete_many<D>(
&self,
delete: D,
) -> Result<<D as DeleteSpec>::Output, Error>where
D: DeleteSpec,
pub async fn close(&self)
Trait Implementations§
Source§impl Clone for VitrailClient
impl Clone for VitrailClient
Source§fn clone(&self) -> VitrailClient
fn clone(&self) -> VitrailClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VitrailClient
impl !RefUnwindSafe for VitrailClient
impl Send for VitrailClient
impl Sync for VitrailClient
impl Unpin for VitrailClient
impl UnsafeUnpin for VitrailClient
impl !UnwindSafe for VitrailClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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