pub struct Postgres;Expand description
Namespace for PostgreSQL database constructors.
Provides ergonomic factory methods for creating PostgreSQL-backed storage.
All methods return SqlxBackend which implements BackendImpl.
§Example
ⓘ
use eidetica::backend::database::Postgres;
// Connect to PostgreSQL
let backend = Postgres::connect("postgres://user:pass@localhost/mydb").await?;
// With test isolation (unique schema per instance)
let backend = Postgres::connect_isolated("postgres://localhost/test").await?;Implementations§
Source§impl Postgres
impl Postgres
Sourcepub async fn connect(url: &str) -> Result<SqlxBackend>
pub async fn connect(url: &str) -> Result<SqlxBackend>
Connect to a PostgreSQL database using a connection URL.
This connects to the default (public) schema. For test isolation,
use connect_isolated() instead.
§Arguments
url- PostgreSQL connection URL (e.g., “postgres://user:pass@localhost/dbname”)
Sourcepub async fn connect_isolated(url: &str) -> Result<SqlxBackend>
pub async fn connect_isolated(url: &str) -> Result<SqlxBackend>
Connect to a PostgreSQL database with test isolation.
Creates a unique schema for this backend instance, ensuring tests don’t interfere with each other when run in parallel.
§Arguments
url- PostgreSQL connection URL
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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