Trait df_db::db::Request

source ·
pub trait Request {
Show 29 methods // Required methods fn table_create(&mut self, data: ModelTable) -> bool; fn table_update(&mut self, data: ModelTable) -> bool; fn table_info(&mut self, table: &str) -> JsonValue; fn table_is_exist(&mut self, name: &str) -> bool; fn table(&mut self, name: &str) -> &mut Self; fn order(&mut self, field: &str, by: bool) -> &mut Self; fn group(&mut self, field: &str) -> &mut Self; fn distinct(&mut self, distinct: bool) -> &mut Self; fn json(&mut self, field: &str) -> &mut Self; fn column(&mut self, field: &str) -> JsonValue; fn where_and(
&mut self,
field: &str,
compare: &str,
value: JsonValue
) -> &mut Self; fn where_or(
&mut self,
field: &str,
compare: &str,
value: JsonValue
) -> &mut Self; fn count(&mut self) -> i64; fn max(&mut self, field: &str) -> JsonValue; fn min(&mut self, field: &str) -> JsonValue; fn sum(&mut self, field: &str) -> JsonValue; fn avg(&mut self, field: &str) -> JsonValue; fn select(&mut self) -> JsonValue; fn find(&mut self) -> JsonValue; fn insert(&mut self, data: JsonValue) -> JsonValue; fn insert_all(&mut self, data: JsonValue) -> JsonValue; fn page(&mut self, page: i32, limit: i32) -> &mut Self; fn update(&mut self, data: JsonValue) -> i32; fn delete(&mut self) -> i32; fn field(&mut self, name: &str) -> &mut Self; fn transaction(&mut self) -> bool; fn commit(&mut self) -> bool; fn rollback(&mut self) -> bool; fn sql(&mut self, sql: String) -> JsonValue;
}

Required Methods§

source

fn table_create(&mut self, data: ModelTable) -> bool

source

fn table_update(&mut self, data: ModelTable) -> bool

source

fn table_info(&mut self, table: &str) -> JsonValue

source

fn table_is_exist(&mut self, name: &str) -> bool

source

fn table(&mut self, name: &str) -> &mut Self

source

fn order(&mut self, field: &str, by: bool) -> &mut Self

排序

source

fn group(&mut self, field: &str) -> &mut Self

分组

source

fn distinct(&mut self, distinct: bool) -> &mut Self

消除重复记录

source

fn json(&mut self, field: &str) -> &mut Self

JSON 字段

source

fn column(&mut self, field: &str) -> JsonValue

查询指定列并返回数组

source

fn where_and(&mut self, field: &str, compare: &str, value: JsonValue) -> &mut Self

source

fn where_or(&mut self, field: &str, compare: &str, value: JsonValue) -> &mut Self

source

fn count(&mut self) -> i64

source

fn max(&mut self, field: &str) -> JsonValue

source

fn min(&mut self, field: &str) -> JsonValue

source

fn sum(&mut self, field: &str) -> JsonValue

source

fn avg(&mut self, field: &str) -> JsonValue

source

fn select(&mut self) -> JsonValue

source

fn find(&mut self) -> JsonValue

source

fn insert(&mut self, data: JsonValue) -> JsonValue

source

fn insert_all(&mut self, data: JsonValue) -> JsonValue

source

fn page(&mut self, page: i32, limit: i32) -> &mut Self

source

fn update(&mut self, data: JsonValue) -> i32

source

fn delete(&mut self) -> i32

source

fn field(&mut self, name: &str) -> &mut Self

source

fn transaction(&mut self) -> bool

事务开始

source

fn commit(&mut self) -> bool

事务提交

source

fn rollback(&mut self) -> bool

事务回滚

source

fn sql(&mut self, sql: String) -> JsonValue

Implementors§