pub struct PostgresStoreConfig { /* private fields */ }Expand description
Complete, validated store startup configuration.
Connection URLs are intentionally omitted from Debug and
have no public accessor. Use PostgresStoreConfig::builder for production
or PostgresStoreConfig::development for an explicit local-development
profile.
Implementations§
Source§impl PostgresStoreConfig
impl PostgresStoreConfig
Sourcepub fn builder(database_url: impl Into<String>) -> PostgresStoreConfigBuilder
pub fn builder(database_url: impl Into<String>) -> PostgresStoreConfigBuilder
Starts a production-safe builder for one runtime connection URL.
Sourcepub fn development(
database_url: impl Into<String>,
) -> Result<Self, ConfigurationError>
pub fn development( database_url: impl Into<String>, ) -> Result<Self, ConfigurationError>
Builds an explicit local-development profile.
This profile disables transport security, limits the pool to four connections, and enables migration through the same URL. It must never be used across an untrusted network or as a production deployment shortcut.
§Errors
Returns ConfigurationError when the URL or derived options are
invalid.
Sourcepub fn from_env() -> Result<Self, ConfigurationError>
pub fn from_env() -> Result<Self, ConfigurationError>
Reads a complete configuration from the process environment.
DATABASE_URL is required. Production is the default profile. Setting
STATEKNOT_DEV_MODE=true explicitly selects the development profile;
setting STATEKNOT_AUTO_MIGRATE=true in production additionally
requires a distinct STATEKNOT_MIGRATION_DATABASE_URL.
Boolean values accept only true or false, ignoring ASCII case. URLs
are never included in returned error messages.
§Errors
Returns ConfigurationError for missing/non-Unicode variables,
invalid booleans, unsafe migration configuration, or malformed URLs.
Sourcepub const fn options(&self) -> &PostgresStoreOptions
pub const fn options(&self) -> &PostgresStoreOptions
Returns the validated pool, timeout, transport, and lease options.
Sourcepub const fn auto_migrate(&self) -> bool
pub const fn auto_migrate(&self) -> bool
Returns whether startup will run the embedded migrations before the runtime pool connects.
Sourcepub const fn profile(&self) -> PostgresConfigurationProfile
pub const fn profile(&self) -> PostgresConfigurationProfile
Returns the selected security profile.
Trait Implementations§
Source§impl Clone for PostgresStoreConfig
impl Clone for PostgresStoreConfig
Auto Trait Implementations§
impl Forget for PostgresStoreConfig
impl Freeze for PostgresStoreConfig
impl Move for PostgresStoreConfig
impl RefUnwindSafe for PostgresStoreConfig
impl Send for PostgresStoreConfig
impl Sync for PostgresStoreConfig
impl Unpin for PostgresStoreConfig
impl UnsafeUnpin for PostgresStoreConfig
impl UnwindSafe for PostgresStoreConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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