Trait ergol::ToTable[][src]

pub trait ToTable: Send + Debug + Sized {
    fn from_row_with_offset(row: &Row, offset: usize) -> Self;
fn table_name() -> &'static str;
fn id_name() -> &'static str;
fn id(&self) -> i32;
fn create_table() -> CreateTable;
fn drop_table() -> DropTable;
fn select() -> Select<Self>; fn from_row(row: &Row) -> Self { ... } }
Expand description

Any type that should be transformed into a table should implement this trait.

You should not implement this trait yourself, and use the #ergol macro to implement this trait for your structs.

Required methods

Converts a row of a table into an object.

Returns the name of the table corresponding to Self.

Returns the name of the primary key of the table corresponding to Self.

Returns the id of self.

Returns the query that creates the table.

Returns the query that drops the table.

Returns a select query.

Provided methods

Converts a row of a table into an object.

Implementors