pub struct DatasourceIr {
pub name: String,
pub provider: String,
pub url: String,
pub direct_url: Option<String>,
pub span: Span,
}Expand description
Validated datasource configuration.
Fields§
§name: StringThe datasource name (e.g., “db”).
provider: StringThe provider (e.g., “postgresql”, “mysql”, “sqlite”).
url: StringThe connection URL (may contain env() references).
direct_url: Option<String>Optional direct connection URL for admin/introspection paths.
When present, tooling such as db pull, db push, and migrations can
prefer this over url so runtime traffic can continue to use a pooled
connection string.
span: SpanSpan of the datasource block.
Implementations§
Source§impl DatasourceIr
impl DatasourceIr
Sourcepub fn runtime_url(&self) -> &str
pub fn runtime_url(&self) -> &str
Returns the preferred runtime URL expression.
Runtime clients should prefer url and only fall back to direct_url
when url is unavailable.
Trait Implementations§
Source§impl Clone for DatasourceIr
impl Clone for DatasourceIr
Source§fn clone(&self) -> DatasourceIr
fn clone(&self) -> DatasourceIr
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 Debug for DatasourceIr
impl Debug for DatasourceIr
Source§impl PartialEq for DatasourceIr
impl PartialEq for DatasourceIr
impl StructuralPartialEq for DatasourceIr
Auto Trait Implementations§
impl Freeze for DatasourceIr
impl RefUnwindSafe for DatasourceIr
impl Send for DatasourceIr
impl Sync for DatasourceIr
impl Unpin for DatasourceIr
impl UnsafeUnpin for DatasourceIr
impl UnwindSafe for DatasourceIr
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