pub struct PostgresTestDatabase { /* private fields */ }Expand description
One migrated Postgres schema. Use config to construct a pool/store;
it carries the schema in the startup search_path, so every pooled connection sees
the same isolated namespace.
Implementations§
Source§impl PostgresTestDatabase
impl PostgresTestDatabase
pub async fn create(conninfo: &str) -> Result<Self, TestDatabaseError>
pub fn schema(&self) -> &str
pub fn config(&self) -> Config
Sourcepub async fn cleanup(self) -> Result<(), TestDatabaseError>
pub async fn cleanup(self) -> Result<(), TestDatabaseError>
Drop only this helper’s generated schema and every object the migrator installed in it. The helper consumes itself so cleanup cannot accidentally run twice.
Auto Trait Implementations§
impl Freeze for PostgresTestDatabase
impl RefUnwindSafe for PostgresTestDatabase
impl Send for PostgresTestDatabase
impl Sync for PostgresTestDatabase
impl Unpin for PostgresTestDatabase
impl UnsafeUnpin for PostgresTestDatabase
impl UnwindSafe for PostgresTestDatabase
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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