1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::data::{DbHost, DbName, DbPass, DbUser};

pub mod queries;

use serde::Deserialize;

/// Information required to connect to a database
#[derive(Debug, Clone, Deserialize)]
pub struct DbConfig {
    /// The name of the database
    pub name: DbName,
    /// The user to connect with
    pub user: DbUser,
    /// The hostname to connect to
    pub host: DbHost,
    /// The corresponding password for this user
    pub password: Option<DbPass>,
    /// The time limit in seconds applied to each socket-level connection attempt.
    pub connect_timeout: u32,
    /// The number of seconds of inactivity after which a keepalive message is sent to the server
    pub keepalives_idle: u32,
    /// The time interval between TCP keepalive probes
    pub keepalives_interval: u32,
    /// The maximum number of TCP keepalive probes that will be sent before dropping a connection.
    pub keepalives_retries: u32,
}