1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::value::{MySqlValue, MySqlValueRef};
use crate::{
    MySqlArguments, MySqlColumn, MySqlConnection, MySqlQueryResult, MySqlRow, MySqlStatement,
    MySqlTransactionManager, MySqlTypeInfo,
};
pub(crate) use sqlx_core::database::{Database, HasStatementCache};

/// MySQL database driver.
#[derive(Debug)]
pub struct MySql;

impl Database for MySql {
    type Connection = MySqlConnection;

    type TransactionManager = MySqlTransactionManager;

    type Row = MySqlRow;

    type QueryResult = MySqlQueryResult;

    type Column = MySqlColumn;

    type TypeInfo = MySqlTypeInfo;

    type Value = MySqlValue;
    type ValueRef<'r> = MySqlValueRef<'r>;

    type Arguments<'q> = MySqlArguments;
    type ArgumentBuffer<'q> = Vec<u8>;

    type Statement<'q> = MySqlStatement<'q>;

    const NAME: &'static str = "MySQL";

    const URL_SCHEMES: &'static [&'static str] = &["mysql", "mariadb"];
}

impl HasStatementCache for MySql {}