mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
Compile-time support for external drivers (#3889)
* Make sqlx-macros-core::database public * Move driver installation to bins * Fix lint
This commit is contained in:
parent
a0e40540e3
commit
ba23fdeb76
@ -15,6 +15,8 @@ enum Cli {
|
||||
async fn main() {
|
||||
sqlx_cli::maybe_apply_dotenv();
|
||||
|
||||
sqlx::any::install_default_drivers();
|
||||
|
||||
let Cli::Sqlx(opt) = Cli::parse();
|
||||
|
||||
if let Err(error) = sqlx_cli::run(opt).await {
|
||||
|
@ -7,6 +7,8 @@ async fn main() {
|
||||
// Checks for `--no-dotenv` before parsing.
|
||||
sqlx_cli::maybe_apply_dotenv();
|
||||
|
||||
sqlx::any::install_default_drivers();
|
||||
|
||||
let opt = Opt::parse();
|
||||
|
||||
// no special handling here
|
||||
|
@ -204,8 +204,6 @@ where
|
||||
F: FnMut(&'a str) -> Fut,
|
||||
Fut: Future<Output = sqlx::Result<T>> + 'a,
|
||||
{
|
||||
sqlx::any::install_default_drivers();
|
||||
|
||||
let db_url = opts.expect_db_url()?;
|
||||
|
||||
backoff::future::retry(
|
||||
|
@ -33,6 +33,7 @@ pub struct CachingDescribeBlocking<DB: DatabaseExt> {
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl<DB: DatabaseExt> CachingDescribeBlocking<DB> {
|
||||
#[allow(clippy::new_without_default, reason = "internal API")]
|
||||
pub const fn new() -> Self {
|
||||
CachingDescribeBlocking {
|
||||
connections: LazyLock::new(|| Mutex::new(HashMap::new())),
|
||||
|
@ -27,7 +27,7 @@ pub type Error = Box<dyn std::error::Error>;
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
mod common;
|
||||
mod database;
|
||||
pub mod database;
|
||||
|
||||
#[cfg(feature = "derive")]
|
||||
pub mod derives;
|
||||
|
Loading…
x
Reference in New Issue
Block a user