Trait orm_macro::OrmRepository
source · pub trait OrmRepository {
// Required methods
fn find(&self) -> String;
fn select_fields(&mut self, fields: Vec<&str>) -> &mut Self;
fn create(&mut self) -> &str;
fn update(&self) -> &str;
fn delete(&self) -> &str;
}Expand description
This trait contains the methods that generate sql
Required Methods§
sourcefn select_fields(&mut self, fields: Vec<&str>) -> &mut Self
👎Deprecated since 1.2.0: Removing this unnecesary method will make find() return &str instead of String, in the future there will be better find methods
fn select_fields(&mut self, fields: Vec<&str>) -> &mut Self
Used to specify which fields to select
sourcefn create(&mut self) -> &str
fn create(&mut self) -> &str
generate: INSERT INTO {table_name} ({struct_fields}) VALUES({$1,$2…}) RETURNING {struct_fields}
Object Safety§
This trait is not object safe.