#![forbid(unsafe_code)]
#![warn(missing_docs)]
macro_rules! impl_execute_affected {
() => {
pub async fn execute_affected(
&self,
sql: &nautilus_dialect::Sql,
) -> $crate::error::Result<usize> {
let mut query = sqlx::query(&sql.text);
for param in &sql.params {
query = bind_value(query, param)?;
}
let result = query
.execute(&self.pool)
.await
.map_err(|e| $crate::error::ConnectorError::database(e, "Mutation failed"))?;
Ok(result.rows_affected() as usize)
}
};
}
mod client;
pub mod error;
mod executor;
mod from_row;
mod mysql;
mod mysql_stream;
mod postgres;
mod postgres_stream;
mod row;
mod row_stream;
mod sqlite;
mod sqlite_stream;
pub mod transaction;
mod utils;
mod value_hint;
pub use client::Client;
pub use error::{ConnectorError, Result as ConnectorResult, SqlxErrorKind};
pub use executor::{execute_all, Executor};
pub use from_row::FromRow;
pub use mysql::MysqlExecutor;
pub use mysql_stream::MysqlRowStream;
pub use postgres::PgExecutor;
pub use postgres_stream::PgRowStream;
pub use row::Row;
pub use row_stream::RowStream;
pub use sqlite::SqliteExecutor;
pub use sqlite_stream::SqliteRowStream;
pub use transaction::{IsolationLevel, TransactionExecutor, TransactionOptions};
pub use value_hint::{
decode_row_with_hints, normalize_row_with_hints, normalize_rows_with_hints, ValueHint,
};
pub use nautilus_core::RowAccess;
pub use nautilus_core::Column;
pub use nautilus_core::FromValue;