| 1 | //! **MySQL** database driver. |
| 2 | #![deny(clippy::cast_possible_truncation)] |
| 3 | #![deny(clippy::cast_possible_wrap)] |
| 4 | #![deny(clippy::cast_sign_loss)] |
| 5 | |
| 6 | #[macro_use] |
| 7 | extern crate sqlx_core; |
| 8 | |
| 9 | use crate::executor::Executor; |
| 10 | |
| 11 | pub(crate) use sqlx_core::driver_prelude::*; |
| 12 | |
| 13 | #[cfg(feature = "any")] |
| 14 | pub mod any; |
| 15 | |
| 16 | mod arguments; |
| 17 | mod collation; |
| 18 | mod column; |
| 19 | mod connection; |
| 20 | mod database; |
| 21 | mod error; |
| 22 | mod io; |
| 23 | mod options; |
| 24 | mod protocol; |
| 25 | mod query_result; |
| 26 | mod row; |
| 27 | mod statement; |
| 28 | mod transaction; |
| 29 | mod type_checking; |
| 30 | mod type_info; |
| 31 | pub mod types; |
| 32 | mod value; |
| 33 | |
| 34 | #[cfg(feature = "migrate")] |
| 35 | mod migrate; |
| 36 | |
| 37 | #[cfg(feature = "migrate")] |
| 38 | mod testing; |
| 39 | |
| 40 | pub use arguments::MySqlArguments; |
| 41 | pub use column::MySqlColumn; |
| 42 | pub use connection::MySqlConnection; |
| 43 | pub use database::MySql; |
| 44 | pub use error::MySqlDatabaseError; |
| 45 | pub use options::{MySqlConnectOptions, MySqlSslMode}; |
| 46 | pub use query_result::MySqlQueryResult; |
| 47 | pub use row::MySqlRow; |
| 48 | pub use statement::MySqlStatement; |
| 49 | pub use transaction::MySqlTransactionManager; |
| 50 | pub use type_info::MySqlTypeInfo; |
| 51 | pub use value::{MySqlValue, MySqlValueFormat, MySqlValueRef}; |
| 52 | |
| 53 | /// An alias for [`Pool`][crate::pool::Pool], specialized for MySQL. |
| 54 | pub type MySqlPool = crate::pool::Pool<MySql>; |
| 55 | |
| 56 | /// An alias for [`PoolOptions`][crate::pool::PoolOptions], specialized for MySQL. |
| 57 | pub type MySqlPoolOptions = crate::pool::PoolOptions<MySql>; |
| 58 | |
| 59 | /// An alias for [`Executor<'_, Database = MySql>`][Executor]. |
| 60 | pub trait MySqlExecutor<'c>: Executor<'c, Database = MySql> {} |
| 61 | impl<'c, T: Executor<'c, Database = MySql>> MySqlExecutor<'c> for T {} |
| 62 | |
| 63 | /// An alias for [`Transaction`][crate::transaction::Transaction], specialized for MySQL. |
| 64 | pub type MySqlTransaction<'c> = crate::transaction::Transaction<'c, MySql>; |
| 65 | |
| 66 | // NOTE: required due to the lack of lazy normalization |
| 67 | impl_into_arguments_for_arguments!(MySqlArguments); |
| 68 | impl_acquire!(MySql, MySqlConnection); |
| 69 | impl_column_index_for_row!(MySqlRow); |
| 70 | impl_column_index_for_statement!(MySqlStatement); |
| 71 | |
| 72 | // required because some databases have a different handling of NULL |
| 73 | impl_encode_for_option!(MySql); |