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§
Sourceconst TABLE_NAME: &'static str
const TABLE_NAME: &'static str
The table name in the database.
const SQL_NAME: &'static str
const ALIASED_SQL_NAME: &'static str
Required Methods§
Sourcefn table_info() -> TableInfo
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.