pub struct Postgres { /* private fields */ }
Expand description
A wrapped postgres instance.
Contains a handle to a running Postgres process. Once dropped, the instance will be shut down and the temporary directory containing all of its data removed.
Implementations§
Source§impl Postgres
impl Postgres
Sourcepub fn build() -> PostgresBuilder
pub fn build() -> PostgresBuilder
Creates a new Postgres database builder.
Sourcepub fn as_superuser(&self) -> PostgresClient<'_>
pub fn as_superuser(&self) -> PostgresClient<'_>
Returns a postgres client with superuser credentials.
Sourcepub fn as_user(&self, username: &str, password: &str) -> PostgresClient<'_>
pub fn as_user(&self, username: &str, password: &str) -> PostgresClient<'_>
Returns a postgres client that uses the given credentials.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Postgres
impl RefUnwindSafe for Postgres
impl Send for Postgres
impl Sync for Postgres
impl Unpin for Postgres
impl UnwindSafe for Postgres
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> 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