DbBmc

Trait DbBmc 

Source
pub trait DbBmc {
    type Error;
    type IdType: IdType;

    const ENTITY: &'static str;
    const TABLE: &'static str;

    // Required method
    fn id_column() -> DynIden;

    // Provided methods
    fn id_to_value(id: &Self::IdType) -> SimpleExpr { ... }
    fn get_table_ref() -> TableRef { ... }
}
Expand description

The core trait that defines a type that acts as a database model controller.

While not necessary for types to implement this to interact with the db, it acts as a useful standardization for most models that have primary keys.

Required Associated Constants§

Source

const ENTITY: &'static str

The name of the entity this controller acts on (i.e. User).

Source

const TABLE: &'static str

The name of the table in the database the entities reside in.

Required Associated Types§

Source

type Error

Source

type IdType: IdType

The type of the ID column

Required Methods§

Provided Methods§

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.

Implementors§