pub struct Pgsql {
pub connection: Connection,
pub default: String,
pub params: Params,
pub client: Pools,
}Fields§
§connection: Connection当前连接配置
default: String当前选中配置
params: Params§client: PoolsImplementations§
Trait Implementations§
Source§impl Mode for Pgsql
impl Mode for Pgsql
fn table_create(&mut self, options: TableOptions) -> JsonValue
fn table_update(&mut self, options: TableOptions) -> JsonValue
Source§fn table_info(&mut self, table: &str) -> JsonValue
fn table_info(&mut self, table: &str) -> JsonValue
获取表信息
Source§fn table_is_exist(&mut self, name: &str) -> bool
fn table_is_exist(&mut self, name: &str) -> bool
判断表是否存在
Source§fn change_table(&mut self, name: &str) -> &mut Self
fn change_table(&mut self, name: &str) -> &mut Self
别名
Source§fn timestamps(&mut self) -> &mut Self
fn timestamps(&mut self) -> &mut Self
自动时间戳
Source§fn field_raw(&mut self, expr: &str) -> &mut Self
fn field_raw(&mut self, expr: &str) -> &mut Self
原始表达式字段(不加表前缀,如 “SUM(amount) as total”、“CASE WHEN … END as status_count”)
隐藏字段
fn where_or( &mut self, field: &str, compare: &str, value: JsonValue, ) -> &mut Self
Source§fn where_raw(&mut self, expr: &str) -> &mut Self
fn where_raw(&mut self, expr: &str) -> &mut Self
原始 WHERE 条件(不加表前缀,如 “YEAR(created_at) = 2026”)
Source§fn where_in_sub(&mut self, field: &str, sub_sql: &str) -> &mut Self
fn where_in_sub(&mut self, field: &str, sub_sql: &str) -> &mut Self
子查询 WHERE field IN (sub_sql)
Source§fn where_not_in_sub(&mut self, field: &str, sub_sql: &str) -> &mut Self
fn where_not_in_sub(&mut self, field: &str, sub_sql: &str) -> &mut Self
子查询 WHERE field NOT IN (sub_sql)
fn where_exists(&mut self, sub_sql: &str) -> &mut Self
fn where_not_exists(&mut self, sub_sql: &str) -> &mut Self
Source§fn update_column(&mut self, field_a: &str, compare: &str) -> &mut Self
fn update_column(&mut self, field_a: &str, compare: &str) -> &mut Self
更新指定列
Source§fn insert_all(&mut self, data: JsonValue) -> JsonValue
fn insert_all(&mut self, data: JsonValue) -> JsonValue
批量添加
Source§fn update_all(&mut self, data: JsonValue) -> JsonValue
fn update_all(&mut self, data: JsonValue) -> JsonValue
批量更新
Source§fn transaction(&mut self) -> bool
fn transaction(&mut self) -> bool
事务开始
fn sql_execute(&mut self, sql: &str) -> Result<JsonValue, String>
fn join_fields(&mut self, fields: Vec<&str>) -> &mut Self
Source§fn join(
&mut self,
main_table: &str,
main_fields: &str,
right_table: &str,
right_fields: &str,
) -> &mut Self
fn join( &mut self, main_table: &str, main_fields: &str, right_table: &str, right_fields: &str, ) -> &mut Self
连结 Read more
Source§fn join_inner(
&mut self,
table: &str,
main_fields: &str,
second_fields: &str,
) -> &mut Self
fn join_inner( &mut self, table: &str, main_fields: &str, second_fields: &str, ) -> &mut Self
内连接–用来取交集 Read more
Source§fn join_right(
&mut self,
main_table: &str,
main_fields: &str,
right_table: &str,
right_fields: &str,
) -> &mut Self
fn join_right( &mut self, main_table: &str, main_fields: &str, right_table: &str, right_fields: &str, ) -> &mut Self
右连接
Source§fn join_full(
&mut self,
main_table: &str,
main_fields: &str,
right_table: &str,
right_fields: &str,
) -> &mut Self
fn join_full( &mut self, main_table: &str, main_fields: &str, right_table: &str, right_fields: &str, ) -> &mut Self
全连接
fn union(&mut self, sub_sql: &str) -> &mut Self
fn union_all(&mut self, sub_sql: &str) -> &mut Self
fn lock_for_update(&mut self) -> &mut Self
Auto Trait Implementations§
impl Freeze for Pgsql
impl RefUnwindSafe for Pgsql
impl Send for Pgsql
impl Sync for Pgsql
impl Unpin for Pgsql
impl UnsafeUnpin for Pgsql
impl UnwindSafe for Pgsql
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more