Trait diesel::query_source::Table [−][src]
pub trait Table: QuerySource + AsQuery + Sized { type PrimaryKey: SelectableExpression<Self> + NonAggregate; type AllColumns: SelectableExpression<Self> + NonAggregate; fn primary_key(&self) -> Self::PrimaryKey; fn all_columns() -> Self::AllColumns; }
Expand description
A SQL database table. Types which implement this trait should have been
generated by the table!
macro.
Associated Types
type PrimaryKey: SelectableExpression<Self> + NonAggregate
type PrimaryKey: SelectableExpression<Self> + NonAggregate
The type returned by primary_key
type AllColumns: SelectableExpression<Self> + NonAggregate
type AllColumns: SelectableExpression<Self> + NonAggregate
The type returned by all_columns
Required methods
fn primary_key(&self) -> Self::PrimaryKey
fn primary_key(&self) -> Self::PrimaryKey
Returns the primary key of this table.
If the table has a composite primary key, this will be a tuple.
fn all_columns() -> Self::AllColumns
fn all_columns() -> Self::AllColumns
Returns a tuple of all columns belonging to this table.