pub struct DatabaseSettings {
pub backend: DbBackend,
pub url: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub dbname: Option<String>,
pub user: Option<String>,
pub password_file: Option<PathBuf>,
}Expand description
Which database backend modde stores its state in, plus the PostgreSQL
connection parameters (used only when backend = "postgres").
Every field is #[serde(default)], so existing config files round-trip and
default to SQLite. Environment variables override these at startup
(MODDE_DATABASE_BACKEND, MODDE_DATABASE_URL, the discrete
MODDE_DATABASE_HOST/PORT/NAME/USER fields, and
MODDE_DB_PASSWORD_FILE) so the Home Manager module can configure the
backend declaratively without rewriting settings.toml. The PostgreSQL
password is never stored here — it is read at runtime from password_file.
Fields§
§backend: DbBackend§url: Option<String>Full connection URL (e.g. postgres://user@host/db). Takes precedence
over the discrete host/port/dbname/user fields when set.
host: Option<String>§port: Option<u16>§dbname: Option<String>Database name. The matching environment variable is
MODDE_DATABASE_NAME, not MODDE_DATABASE_DBNAME.
user: Option<String>§password_file: Option<PathBuf>Path to a file containing the PostgreSQL password (sops-nix compatible).
Read at runtime; never written back to settings.toml.
Trait Implementations§
Source§impl Clone for DatabaseSettings
impl Clone for DatabaseSettings
Source§fn clone(&self) -> DatabaseSettings
fn clone(&self) -> DatabaseSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DatabaseSettings
impl Debug for DatabaseSettings
Source§impl Default for DatabaseSettings
impl Default for DatabaseSettings
Source§fn default() -> DatabaseSettings
fn default() -> DatabaseSettings
Source§impl<'de> Deserialize<'de> for DatabaseSettings
impl<'de> Deserialize<'de> for DatabaseSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DatabaseSettings
impl RefUnwindSafe for DatabaseSettings
impl Send for DatabaseSettings
impl Sync for DatabaseSettings
impl Unpin for DatabaseSettings
impl UnsafeUnpin for DatabaseSettings
impl UnwindSafe for DatabaseSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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