easy_sql/traits/table.rs
1use easy_macros::always_context;
2
3use crate::Driver;
4
5/// Table metadata used by the query macros.
6///
7/// Prefer implementing this trait via the [`Table`](macro@crate::Table) derive macro or
8/// [`table_join!`](crate::table_join); manual implementations may need updates across releases.
9#[always_context]
10pub trait Table<D: Driver>: Sized {
11 fn table_name() -> &'static str;
12 fn primary_keys() -> Vec<&'static str>;
13
14 /// WARNING: This signature may change in future releases; prefer the macros above.
15 ///
16 /// The name and first argument are stable, but return type and more arguments can be added.
17 fn table_joins(current_query: &mut String);
18}