pub struct Config {
    pub database_url_var: Option<String>,
}Expand description
Configuration shared by multiple components.
Fields§
§database_url_var: Option<String>Override the database URL environment variable.
This is used by both the macros and sqlx-cli.
Case-sensitive. Defaults to DATABASE_URL.
§Example: Multi-Database Project
You can use multiple databases in the same project by breaking it up into multiple crates, then using a different environment variable for each.
For example, with two crates in the workspace named foo and bar:
§foo/sqlx.toml
[common]
database-url-var = "FOO_DATABASE_URL"§bar/sqlx.toml
[common]
database-url-var = "BAR_DATABASE_URL"§.env
FOO_DATABASE_URL=postgres://postgres@localhost:5432/foo
BAR_DATABASE_URL=postgres://postgres@localhost:5432/barThe query macros used in foo will use FOO_DATABASE_URL,
and the ones used in bar will use BAR_DATABASE_URL.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
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> ⓘ
Converts 
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> ⓘ
Converts 
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 more