pub struct DatabaseConfig {Show 14 fields
pub enabled: bool,
pub type: String,
pub host: String,
pub port: Option<u16>,
pub name: String,
pub user: String,
pub password: String,
pub password_encrypted: bool,
pub max_connections: u32,
pub min_connections: u32,
pub connect_timeout: u64,
pub sql_logging: bool,
pub slow_query_ms: u64,
pub migration: MigrationConfig,
}Expand description
数据库配置
Fields§
§enabled: bool是否启用
type: String数据库类型:postgres/mysql/sqlite
host: String主机
port: Option<u16>端口
name: String数据库名
user: String用户名
password: String密码(支持明文或 base64 密文,server.key 解密)
password_encrypted: bool密码是否加密
max_connections: u32最大连接数
min_connections: u32最小空闲连接
connect_timeout: u64连接超时(秒)
sql_logging: bool启用 SQL 日志
slow_query_ms: u64慢查询阈值(毫秒)
migration: MigrationConfig迁移配置
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl Default for DatabaseConfig
impl Default for DatabaseConfig
Source§impl<'de> Deserialize<'de> for DatabaseConfig
impl<'de> Deserialize<'de> for DatabaseConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more