Skip to main content

Table

Trait Table 

Source
pub trait Table<D: Driver>: Sized {
    // Required methods
    fn table_name() -> &'static str;
    fn primary_keys() -> Vec<&'static str>;
    fn table_joins(current_query: &mut String);
}
Expand description

Table metadata used by the query macros.

Prefer implementing this trait via the Table derive macro or table_join!; manual implementations may need updates across releases.

Required Methods§

Source

fn table_name() -> &'static str

Source

fn primary_keys() -> Vec<&'static str>

Source

fn table_joins(current_query: &mut String)

WARNING: This signature may change in future releases; prefer the macros above.

The name and first argument are stable, but return type and more arguments can be added.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D: Driver + 'static> Table<D> for EasySqlTables