drizzle-mysql 0.2.0

A type-safe SQL query builder for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use drizzle_core::SQLTable;

use crate::{common::MySQLSchemaType, values::MySQLValue};

/// A generated table whose SQL and values use the MySQL dialect.
pub trait MySQLTable<'a>: SQLTable<'a, MySQLSchemaType, MySQLValue<'a>> {
    /// Backtick-quoted, database-qualified identifier for const DDL generation.
    const DDL_QUALIFIED_NAME: &'static str;
}

impl<'a, T> MySQLTable<'a> for &T
where
    T: MySQLTable<'a>,
    for<'r> &'r T: SQLTable<'a, MySQLSchemaType, MySQLValue<'a>>,
{
    const DDL_QUALIFIED_NAME: &'static str = T::DDL_QUALIFIED_NAME;
}