Fetchable

Trait Fetchable 

Source
pub trait Fetchable {
    const TABLE: &'static str;
    const SELECT_COLUMNS: &'static [&'static str];
    const FINDABLE_COLUMNS: &'static [(&'static str, &'static str)];
}
Expand description

Marker trait for types that can be fetched from a database. Implemented via #[derive(Fetchable)] proc-macro in storeit_macros.

Provides compile-time metadata used by repository generators.

Required Associated Constants§

Source

const TABLE: &'static str

Source

const SELECT_COLUMNS: &'static [&'static str]

Source

const FINDABLE_COLUMNS: &'static [(&'static str, &'static str)]

A list of (column_name, rust_type) tuples for fields that can be used to generate find_by... 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§