mod connection;
#[cfg(feature = "driver-adapters")]
mod js;
mod transaction;
#[cfg(not(target_arch = "wasm32"))]
pub(crate) mod native {
pub(crate) mod mssql;
pub(crate) mod mysql;
pub(crate) mod postgresql;
pub(crate) mod sqlite;
}
pub(crate) mod operations;
use async_trait::async_trait;
use connector_interface::{error::ConnectorError, Connector};
#[cfg(feature = "driver-adapters")]
pub use js::*;
#[cfg(not(target_arch = "wasm32"))]
pub use native::{mssql::*, mysql::*, postgresql::*, sqlite::*};
#[async_trait]
pub trait FromSource {
async fn from_source(
source: &psl::Datasource,
url: &str,
features: psl::PreviewFeatures,
) -> connector_interface::Result<Self>
where
Self: Connector + Sized;
}
#[inline]
async fn catch<O>(
connection_info: &quaint::prelude::ConnectionInfo,
fut: impl std::future::Future<Output = Result<O, crate::SqlError>>,
) -> Result<O, ConnectorError> {
fut.await.map_err(|err| err.into_connector_error(connection_info))
}