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
//! Database table abstraction; `trait Table`.

//---------------------------------------------------------------------------------------------------- Import

use crate::{key::Key, storable::Storable};

//---------------------------------------------------------------------------------------------------- Table
/// Database table metadata.
///
/// Purely compile time information for database tables.
///
/// See [`crate::define_tables`] for bulk table generation.
pub trait Table: 'static {
    /// Name of the database table.
    const NAME: &'static str;

    /// Primary key type.
    type Key: Key + 'static;

    /// Value type.
    type Value: Storable + 'static;
}

//---------------------------------------------------------------------------------------------------- Tests
#[cfg(test)]
mod test {
    // use super::*;
}