Table

Trait Table 

Source
pub trait Table {
    const TABLE_NAME: &'static str;
    const PK: &'static str;
    const COLUMNS: &'static [&'static str];
    const SQL_NAME: &'static str;
    const ALIASED_SQL_NAME: &'static str;

    // Required method
    fn table_info() -> TableInfo;
}
Expand description

Describes a database table and its metadata used by the query builder.

Implement this trait for your entity types to enable type-safe query building. It provides static metadata such as table name, primary key, and available columns.

Required Associated Constants§

Source

const TABLE_NAME: &'static str

The table name in the database.

Source

const PK: &'static str

The primary key column name.

Source

const COLUMNS: &'static [&'static str]

The list of selectable columns for this table.

Source

const SQL_NAME: &'static str

Source

const ALIASED_SQL_NAME: &'static str

Required Methods§

Source

fn table_info() -> TableInfo

Returns a TableInfo instance used by the query builder.

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§