pub struct SeaOrmConfig {
pub uri: String,
pub enable_logging: bool,
pub min_connections: u32,
pub max_connections: u32,
pub connect_timeout: Option<u64>,
pub idle_timeout: Option<u64>,
pub acquire_timeout: Option<u64>,
}Fields§
§uri: StringThe URI for connecting to the database. For example:
- Postgres:
postgres://root:12341234@localhost:5432/myapp_development - Sqlite:
sqlite://db.sqlite?mode=rwc
enable_logging: boolEnable SQLx statement logging
min_connections: u32Minimum number of connections for a pool
max_connections: u32Maximum number of connections for a pool
connect_timeout: Option<u64>Set the timeout duration when acquiring a connection
idle_timeout: Option<u64>Set a maximum idle duration for individual connections. Any connection that remains in the idle queue longer than this will be closed. For usage-based database server billing, this can be a cost saver.
acquire_timeout: Option<u64>Set the timeout for acquiring a connection
Trait Implementations§
Source§impl Clone for SeaOrmConfig
impl Clone for SeaOrmConfig
Source§fn clone(&self) -> SeaOrmConfig
fn clone(&self) -> SeaOrmConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Configurable for SeaOrmConfig
impl Configurable for SeaOrmConfig
Source§fn config_prefix() -> &'static str
fn config_prefix() -> &'static str
Prefix used to read toml configuration.
If you need to load external configuration, you need to rewrite this method
Source§impl Debug for SeaOrmConfig
impl Debug for SeaOrmConfig
Source§impl<'de> Deserialize<'de> for SeaOrmConfig
impl<'de> Deserialize<'de> for SeaOrmConfig
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
Source§impl JsonSchema for SeaOrmConfig
impl JsonSchema for SeaOrmConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SeaOrmConfig
impl RefUnwindSafe for SeaOrmConfig
impl Send for SeaOrmConfig
impl Sync for SeaOrmConfig
impl Unpin for SeaOrmConfig
impl UnwindSafe for SeaOrmConfig
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