pub struct PgGraphMemoryBuilder<N, E> { /* private fields */ }Expand description
Fluent builder for PgGraphMemory. Use
PgGraphMemory::builder.
Implementations§
Source§impl<N, E> PgGraphMemoryBuilder<N, E>
impl<N, E> PgGraphMemoryBuilder<N, E>
Sourcepub fn with_connection_string(self, url: impl Into<String>) -> Self
pub fn with_connection_string(self, url: impl Into<String>) -> Self
Postgres connection string. Mutually exclusive with
Self::with_pool — the builder rejects construction if
both are set.
Sourcepub fn with_pool(self, pool: Arc<PgPool>) -> Self
pub fn with_pool(self, pool: Arc<PgPool>) -> Self
Reuse an existing pool — useful when the operator already
manages a PgPool for other persistence layers and wants
PgGraphMemory to share it.
Sourcepub fn with_nodes_table(self, name: impl Into<String>) -> Self
pub fn with_nodes_table(self, name: impl Into<String>) -> Self
Override the nodes table name (default graph_nodes).
Sourcepub fn with_edges_table(self, name: impl Into<String>) -> Self
pub fn with_edges_table(self, name: impl Into<String>) -> Self
Override the edges table name (default graph_edges).
Sourcepub const fn with_auto_migrate(self, on: bool) -> Self
pub const fn with_auto_migrate(self, on: bool) -> Self
Toggle the idempotent schema bootstrap. Default true;
set to false when the schema is owned externally.
Sourcepub async fn build(self) -> PgGraphMemoryResult<PgGraphMemory<N, E>>
pub async fn build(self) -> PgGraphMemoryResult<PgGraphMemory<N, E>>
Open the pool (if needed), run the migration (if enabled), and return the configured backend.
Trait Implementations§
Auto Trait Implementations§
impl<N, E> Freeze for PgGraphMemoryBuilder<N, E>
impl<N, E> !RefUnwindSafe for PgGraphMemoryBuilder<N, E>
impl<N, E> Send for PgGraphMemoryBuilder<N, E>
impl<N, E> Sync for PgGraphMemoryBuilder<N, E>
impl<N, E> Unpin for PgGraphMemoryBuilder<N, E>
impl<N, E> UnsafeUnpin for PgGraphMemoryBuilder<N, E>
impl<N, E> !UnwindSafe for PgGraphMemoryBuilder<N, E>
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> 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