pub struct DatabaseConfig {Show 14 fields
pub backend: DatabaseBackend,
pub host: String,
pub port: u16,
pub user: String,
pub password: Option<String>,
pub name: Option<String>,
pub charset: Option<String>,
pub ssl: bool,
pub ssl_ca: Option<String>,
pub ssl_cert: Option<String>,
pub ssl_key: Option<String>,
pub ssl_verify_cert: bool,
pub read_only: bool,
pub max_pool_size: u32,
}Expand description
Database connection and behavior settings.
All fields are fully resolved — no Option indirection for connection
fields. Defaults are applied during construction in From<&Cli>.
Fields§
§backend: DatabaseBackendDatabase backend type.
host: StringDatabase host (resolved default: "localhost").
port: u16Database port (resolved default: backend-dependent).
user: StringDatabase user (resolved default: backend-dependent).
password: Option<String>Database password.
name: Option<String>Database name or SQLite file path.
charset: Option<String>Character set for MySQL/MariaDB connections.
ssl: boolEnable SSL/TLS for the database connection.
ssl_ca: Option<String>Path to the CA certificate for SSL.
ssl_cert: Option<String>Path to the client certificate for SSL.
ssl_key: Option<String>Path to the client key for SSL.
ssl_verify_cert: boolWhether to verify the server certificate.
read_only: boolWhether the server runs in read-only mode.
max_pool_size: u32Maximum database connection pool size.
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub const DEFAULT_BACKEND: DatabaseBackend = DatabaseBackend::Mysql
pub const DEFAULT_BACKEND: DatabaseBackend = DatabaseBackend::Mysql
Default database backend.
Sourcepub const DEFAULT_HOST: &'static str = "localhost"
pub const DEFAULT_HOST: &'static str = "localhost"
Default database host.
Sourcepub const DEFAULT_SSL: bool = false
pub const DEFAULT_SSL: bool = false
Default SSL enabled state.
Sourcepub const DEFAULT_SSL_VERIFY_CERT: bool = true
pub const DEFAULT_SSL_VERIFY_CERT: bool = true
Default SSL certificate verification.
Sourcepub const DEFAULT_READ_ONLY: bool = true
pub const DEFAULT_READ_ONLY: bool = true
Default read-only mode.
Sourcepub const DEFAULT_MAX_POOL_SIZE: u32 = 10
pub const DEFAULT_MAX_POOL_SIZE: u32 = 10
Default connection pool size.
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl Default for DatabaseConfig
impl Default for DatabaseConfig
Source§impl From<&DatabaseConfig> for MySqlConnectOptions
Converts DatabaseConfig into MySqlConnectOptions.
impl From<&DatabaseConfig> for MySqlConnectOptions
Converts DatabaseConfig into MySqlConnectOptions.
Source§fn from(config: &DatabaseConfig) -> Self
fn from(config: &DatabaseConfig) -> Self
Source§impl From<&DatabaseConfig> for PgConnectOptions
Converts DatabaseConfig into PgConnectOptions.
impl From<&DatabaseConfig> for PgConnectOptions
Converts DatabaseConfig into PgConnectOptions.
Uses PgConnectOptions::new_without_pgpass to avoid unintended
PG* environment variable influence, since our config already
resolves values from CLI/env.
Source§fn from(config: &DatabaseConfig) -> Self
fn from(config: &DatabaseConfig) -> Self
Source§impl From<&DatabaseConfig> for SqliteConnectOptions
Converts DatabaseConfig into SqliteConnectOptions.
impl From<&DatabaseConfig> for SqliteConnectOptions
Converts DatabaseConfig into SqliteConnectOptions.
Source§fn from(config: &DatabaseConfig) -> Self
fn from(config: &DatabaseConfig) -> Self
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
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,
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