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: &'static 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) -> crate::error::Result<Box<dyn Iterator<Item = String> + '_>>;
45}