pub struct Source {
pub source_type: SourceType,
pub connection: Option<ConnectionSpec>,
}Expand description
The database documents are read from. Today that’s always Postgres.
The connection is stored unresolved (a literal or an environment reference)
and resolved at runtime by resolve_connection_url,
so a compiled config carries no secret it wasn’t given literally.
Fields§
§source_type: SourceType§connection: Option<ConnectionSpec>How to reach the database. None means “rely entirely on
DATABASE_URL”, checked when the connection is resolved.
Implementations§
Source§impl Source
impl Source
Sourcepub fn resolve_connection_url(&self) -> Result<ConnectionUrl, ResolveError>
pub fn resolve_connection_url(&self) -> Result<ConnectionUrl, ResolveError>
Resolve the connection URL now, in the current environment, applying the
DATABASE_URL deployment override. Call this at connect time, not at
load time, so the value is read where the pipeline runs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
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
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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