Skip to main content

drizzle_sqlite/traits/
table.rs

1use drizzle_core::SQLTable;
2
3use crate::common::SQLiteSchemaType;
4use crate::values::SQLiteValue;
5
6/// A `SQLite` table. Implemented by `#[SQLiteTable]`.
7pub trait SQLiteTable<'a>: SQLTable<'a, SQLiteSchemaType, SQLiteValue<'a>> {
8    /// `true` if the table was declared `WITHOUT ROWID`.
9    const WITHOUT_ROWID: bool;
10    /// `true` if the table was declared `STRICT`.
11    const STRICT: bool;
12}
13
14impl<'a, T> SQLiteTable<'a> for &T
15where
16    T: SQLiteTable<'a>,
17    for<'x> &'x T: SQLTable<'a, SQLiteSchemaType, SQLiteValue<'a>>,
18{
19    const WITHOUT_ROWID: bool = T::WITHOUT_ROWID;
20    const STRICT: bool = T::STRICT;
21}