#[cfg(any(feature = "mysql", feature = "mariadb"))]
mod connection;
mod types;
pub(crate) mod query_builder;
mod value;
use core::hash::Hash;
use crate::backend::{Backend, DieselReserveSpecialization};
use crate::mysql_like::query_builder::MysqlLikeQueryBuilder;
use crate::query_builder::bind_collector::RawBytesBindCollector;
use crate::result::DatabaseErrorKind;
use crate::sql_types::TypeMetadata;
#[cfg(any(feature = "mysql", feature = "mariadb"))]
pub use self::connection::MysqlLikeConnection;
pub use self::value::{MysqlValue, NumericRepresentation};
#[doc(inline)]
pub use sqlstate::mysql_like as sql_state;
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::MysqlTime;
#[doc(inline)]
pub use super::types::date_and_time::MysqlTimestampType;
}
pub mod sql_types {
#[doc(inline)]
pub use super::types::Datetime;
#[doc(inline)]
pub use super::types::Unsigned;
}
#[cfg_attr(
not(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"),
expect(private_bounds)
)]
pub trait MysqlLikeBackend
where
Self: for<'a> Backend<
RawValue<'a> = MysqlValue<'a>,
BindCollector<'a> = RawBytesBindCollector<Self>,
>,
Self: TypeMetadata<TypeMetadata = MysqlType, MetadataLookup = ()>,
Self: Backend<QueryBuilder = MysqlLikeQueryBuilder<Self>>,
Self: Hash + Eq + Default,
Self: DieselReserveSpecialization,
Self: MapErrorNumber,
Self: 'static,
{
#[doc(hidden)]
const SCHEME: &'static str;
}
#[diesel_derives::__diesel_public_if(
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
)]
pub(crate) trait MapErrorNumber {
#[cfg_attr(
not(any(
feature = "mysql",
feature = "mariadb",
feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
)),
expect(dead_code, reason = "only the connections call it")
)]
fn map_error_number(error_number: u32) -> DatabaseErrorKind;
}
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub enum MysqlType {
Tiny,
UnsignedTiny,
Short,
UnsignedShort,
Long,
UnsignedLong,
LongLong,
UnsignedLongLong,
Float,
Double,
Numeric,
Time,
Date,
DateTime,
Timestamp,
String,
Blob,
Bit,
Set,
Enum,
}
pub(crate) mod query_fragments {
use crate::backend::sql_dialect::batch_update_support::SupportsBatchUpdate;
use crate::backend::sql_dialect::on_conflict_clause::SupportsOnConflictClause;
#[derive(Debug, Clone, Copy)]
pub struct MysqlStyleDefaultValueClause;
#[derive(Debug, Clone, Copy)]
pub struct MysqlConcatClause;
#[derive(Debug, Clone, Copy)]
pub struct MysqlOnConflictClause;
#[derive(Debug, Clone, Copy)]
pub struct MysqlRequiresOrderForWindowFunctions;
impl SupportsOnConflictClause for MysqlOnConflictClause {}
#[derive(Debug, Clone, Copy)]
pub struct MySqlLikeBatchUpdateSupport;
impl SupportsBatchUpdate for MySqlLikeBatchUpdateSupport {}
}