AnyConnection (connection/mod.rs)

sqlx · sqlx-core/src/any/connection/mod.rs · rust · Apache-2.0
database, Database / ORM

Generic database connection type that works with any SQLx-supported backend.

// Source: https://github.com/transact-rs/sqlx | License: Apache-2.0 | Copyright SQLx Contributors
// Provided via justclaw.it.com; keep this notice with the code.
use futures_core::future::BoxFuture;
use std::future::Future;

use crate::any::{Any, AnyConnectOptions};
use crate::connection::{ConnectOptions, Connection};
use crate::error::Error;

use crate::config;
use crate::database::Database;
use crate::sql_str::SqlSafeStr;
use crate::transaction::Transaction;
pub use backend::AnyConnectionBackend;

mod backend;
mod executor;

/// A connection to _any_ SQLx database.
///
/// The database driver used is determined by the scheme
/// of the connection url.
///
/// ```text
/// postgres://postgres@localhost/test
/// sqlite://a.sqlite
/// ```
#[derive(Debug)]
pub struct AnyConnection {
    pub

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key