Trait TablePrimaryKey

Source
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§

Source

fn primary_key() -> String

Get the name of the primary key column

Source

fn primary_key_value(&self) -> Value

Get the primary key column name

Provided Methods§

Source

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.

Implementors§