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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use crate::rqlite;
pub(crate) use sqlx_core::database::{
    Database, HasArguments, HasStatement, HasStatementCache, HasValueRef,
};

use crate::{
    connection::RqliteConnection, /*RqliteArgumentValue,*/ RqliteArguments, RqliteColumn,
    /*RqliteConnection, */ RqliteQueryResult, RqliteRow, RqliteStatement,
    RqliteTransactionManager, RqliteTypeInfo, RqliteValue, RqliteValueRef,
};

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

impl Database for Rqlite {
    type Connection = RqliteConnection;

    type TransactionManager = RqliteTransactionManager;

    type Row = RqliteRow;

    type QueryResult = RqliteQueryResult;

    type Column = RqliteColumn;

    type TypeInfo = RqliteTypeInfo;

    type Value = RqliteValue;

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

    const URL_SCHEMES: &'static [&'static str] = &["rqlite"];
}

impl<'r> HasValueRef<'r> for Rqlite {
    type Database = Rqlite;

    type ValueRef = RqliteValueRef<'r>;
}

impl<'q> HasArguments<'q> for Rqlite {
    type Database = Rqlite;

    type Arguments = RqliteArguments;

    type ArgumentBuffer = Vec<rqlite::Value>;
}

impl<'q> HasStatement<'q> for Rqlite {
    type Database = Rqlite;

    type Statement = RqliteStatement<'q>;
}

impl HasStatementCache for Rqlite {}