Trait diesel::prelude::Table

source ·
pub trait Table: QuerySource + AsQuery + Sized {
    type PrimaryKey: SelectableExpression<Self> + ValidGrouping<()>;
    type AllColumns: SelectableExpression<Self> + ValidGrouping<()>;

    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.

Required Associated Types§

The type returned by primary_key

The type returned by all_columns

Required Methods§

Returns the primary key of this table.

If the table has a composite primary key, this will be a tuple.

Returns a tuple of all columns belonging to this table.

Implementors§