pub struct DatabaseConfiguration {
    pub driver: DatabaseDriver,
    pub min_connections: u32,
    pub max_connections: u32,
    pub disable_logging: Option<bool>,
    pub statement_log_level: Option<LevelFilter>,
    pub slow_statement_log_level: Option<LevelFilter>,
}
Expand description

Configuration to create a database connection.

min_connections and max_connections must be greater than 0 and max_connections must be greater or equals min_connections.

Fields§

§driver: DatabaseDriver

The driver and its corresponding settings

§min_connections: u32

Minimal connections to initialize upfront.

§max_connections: u32

Maximum connections that allowed to be created.

§disable_logging: Option<bool>

If set to true, logging will be completely disabled.

In case of None, false will be used.

§statement_log_level: Option<LevelFilter>

Set the log level of SQL statements

In case of None, LevelFilter::Debug will be used.

§slow_statement_log_level: Option<LevelFilter>

Log level in case of slow statements (>300 ms)

In case of None, LevelFilter::Warn will be used.

Implementations§

Create a new database configuration with some defaults set.

Defaults:

Parameter:

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.