Trait geekorm_core::TablePrimaryKey

source ·
pub trait TablePrimaryKey{
    // Required methods
    fn primary_key() -> String;
    fn primary_key_value(&self) -> Value;

    // Provided method
    fn 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 select_by_primary_key(pk: impl Into<Value>) -> Query

Select a row by the primary key

Object Safety§

This trait is not object safe.

Implementors§