pub trait Schema {
// Required methods
fn schema_postgres() -> &'static str;
fn schema_sqlite() -> &'static str;
// Provided method
fn schema(pool: &Pool) -> &'static str { ... }
}
Required Methods§
Sourcefn schema_postgres() -> &'static str
fn schema_postgres() -> &'static str
The generated table schema for PostgreSQL.
Sourcefn schema_sqlite() -> &'static str
fn schema_sqlite() -> &'static str
The generated table schema for SQLite.
§Examples
#[derive(db_derive::Table)]
#[table(schema)]
struct Tag {
#[table(rename = "Id")]
id: String,
#[table(rename = "Name")]
name: String,
}
assert_eq!("", Tag::schema_sqlite());
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.