SQLSchema

Trait SQLSchema 

Source
pub trait SQLSchema<'a, T, V>: ToSQL<'a, V>
where V: SQLParam + 'a,
{ const NAME: &'a str; const TYPE: T; const SQL: &'static str; // Provided method fn sql(&self) -> SQL<'a, V> { ... } }
Expand description

Trait for schema elements (tables, columns, etc.).

The 'a lifetime ties any borrowed parameter values to generated SQL.

Required Associated Constants§

Source

const NAME: &'a str

Source

const TYPE: T

Source

const SQL: &'static str

Static SQL string for schema creation (e.g., CREATE TABLE …)

Provided Methods§

Source

fn sql(&self) -> SQL<'a, V>

Generate SQL for this schema element. Default implementation wraps the static SQL string.

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§