Skip to main content

Table

Trait Table 

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

    // Required methods
    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§

Source

type PrimaryKey: SelectableExpression<Self> + ValidGrouping<()>

The type returned by primary_key

Source

type AllColumns: SelectableExpression<Self> + ValidGrouping<()>

The type returned by all_columns

Required Methods§

Source

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.

Source

fn all_columns() -> Self::AllColumns

Returns a tuple of all columns belonging to this table.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S, TSM> Table for Tablesample<S, TSM>

Available on crate feature postgres_backend only.
Source§

impl<S> Table for Only<S>

Available on crate feature postgres_backend only.