pub struct DatabaseRuntimeConfig {
pub url: Option<String>,
pub pool_min: usize,
pub pool_max: usize,
pub connect_timeout_ms: u64,
pub idle_timeout_ms: u64,
pub ssl_mode: String,
}Expand description
Database connection pool runtime configuration.
The [database] section in fraiseql.toml is optional. When absent,
connection parameters fall back to the DATABASE_URL environment variable
or the --database CLI flag.
Supports ${VAR} environment variable interpolation in the url field:
[database]
url = "${DATABASE_URL}"
pool_min = 2
pool_max = 20
ssl_mode = "prefer"Fields§
§url: Option<String>Database connection URL. Supports ${VAR} interpolation.
If not set here, the runtime falls back to the DATABASE_URL environment
variable or the --database CLI flag.
pool_min: usizeMinimum connection pool size. Default: 2.
pool_max: usizeMaximum connection pool size. Default: 20.
connect_timeout_ms: u64Connection acquisition timeout in milliseconds. Default: 5 000 (5 s).
idle_timeout_ms: u64Idle connection lifetime in milliseconds. Default: 600 000 (10 min).
ssl_mode: StringPostgreSQL SSL mode: "disable", "allow", "prefer", or "require".
Default: "prefer".
Implementations§
Trait Implementations§
Source§impl Clone for DatabaseRuntimeConfig
impl Clone for DatabaseRuntimeConfig
Source§fn clone(&self) -> DatabaseRuntimeConfig
fn clone(&self) -> DatabaseRuntimeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DatabaseRuntimeConfig
impl Debug for DatabaseRuntimeConfig
Source§impl Default for DatabaseRuntimeConfig
impl Default for DatabaseRuntimeConfig
Source§impl<'de> Deserialize<'de> for DatabaseRuntimeConfigwhere
DatabaseRuntimeConfig: Default,
impl<'de> Deserialize<'de> for DatabaseRuntimeConfigwhere
DatabaseRuntimeConfig: Default,
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>,
Auto Trait Implementations§
impl Freeze for DatabaseRuntimeConfig
impl RefUnwindSafe for DatabaseRuntimeConfig
impl Send for DatabaseRuntimeConfig
impl Sync for DatabaseRuntimeConfig
impl Unpin for DatabaseRuntimeConfig
impl UnsafeUnpin for DatabaseRuntimeConfig
impl UnwindSafe for DatabaseRuntimeConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().