drizzle_core/traits/
mod.rs1use crate::prelude::*;
4use core::any::Any;
5
6mod column;
7mod index;
8mod param;
9mod table;
10mod to_sql;
11mod tuple;
12mod view;
13
14pub use column::*;
15pub use index::*;
16pub use param::*;
17pub use table::*;
18pub use to_sql::*;
19pub use view::*;
20
21use crate::sql::SQL;
22
23pub trait SQLSchema<'a, T, V: SQLParam + 'a>: ToSQL<'a, V> {
27 const NAME: &'a str;
28 const TYPE: T;
29 const SQL: &'static str;
31
32 fn sql(&self) -> SQL<'a, V> {
35 SQL::raw(Self::SQL)
36 }
37}
38
39pub trait SQLSchemaType: core::fmt::Debug + Any + Send + Sync {}
41
42pub trait SQLSchemaImpl: Any + Send + Sync {
44 fn create_statements(&self) -> Vec<String>;
45}
46
47pub trait SQLComparable<'a, V: SQLParam, Rhs> {}
49
50impl<'a, V, L, R> SQLComparable<'a, V, R> for L
51where
52 V: SQLParam + 'a,
53 L: ToSQL<'a, V>,
54 R: ToSQL<'a, V>,
55{
56}