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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use ;
use Duration;
/// `DatabaseConfig` represents the configuration for connecting to a database.
///
/// This configuration object can be used to set up a connection pool
/// to PostgreSQL or another `sqlx`-supported database.
///
/// Configuration fields can be loaded from various sources, such as YAML, JSON
/// configuration files, or from environment variables.
///
/// Example configuration in YAML:
///
/// ```yaml
/// host: localhost
/// port: 5432
/// username: user
/// password: password
/// database: test
/// max_open_cons: 10
/// min_idle_cons: 5
/// conn_max_lifetime:
/// secs: 900
/// nanos: 0
/// connection_timeout:
/// secs: 15
/// nanos: 0
/// idle_timeout:
/// secs: 3600
/// nanos: 0
/// ```