pub trait TablePrimaryKey{
// Required methods
fn primary_key() -> String;
fn primary_key_value(&self) -> Value;
// Provided method
fn query_select_by_primary_key(pk: impl Into<Value>) -> Query { ... }
}
Expand description
Trait for Tables with a primary key
Required Methods§
Sourcefn primary_key() -> String
fn primary_key() -> String
Get the name of the primary key column
Sourcefn primary_key_value(&self) -> Value
fn primary_key_value(&self) -> Value
Get the primary key column name
Provided Methods§
Sourcefn query_select_by_primary_key(pk: impl Into<Value>) -> Query
fn query_select_by_primary_key(pk: impl Into<Value>) -> Query
Select a row by the primary key
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.