Enum Db

Source
pub enum Db {
    None,
}

Variants§

§

None

Implementations§

Source§

impl Db

Source

pub fn load(path: &str) -> Result<Db, String>

Source

pub fn new(config: Config) -> Result<Db, String>

Source

pub fn get_config_default(&mut self) -> String

Source

pub fn get_config_list(&mut self) -> Vec<String>

Source

pub fn connection(&mut self, name: &str) -> Db

Source

pub fn connection_add( &mut self, config_name: &str, connection: Connection, ) -> Db

增加配置

Source

pub fn table_create(&mut self, options: TableOptions) -> JsonValue

具体功能

Source

pub fn table_update(&mut self, options: TableOptions) -> JsonValue

Source

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

Source

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

Source

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

Source

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

Source

pub fn autoinc(&mut self) -> &mut Self

Source

pub fn fetch_sql(&mut self) -> &mut Self

Source

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

排序

  • field 排序字段
  • by 排序方法 true 降序 false 升序
Source

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

Source

pub fn distinct(&mut self) -> &mut Self

Source

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

Source

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

坐标系

Source

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

Source

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

Source

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

Source

pub fn where_column( &mut self, field_a: &str, compare: &str, field_b: &str, ) -> &mut Self

Source

pub fn count(&mut self) -> JsonValue

Source

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

Source

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

Source

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

Source

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

Source

pub fn select(&mut self) -> JsonValue

Source

pub fn find(&mut self) -> JsonValue

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_connection(&mut self) -> Connection

Source

pub fn database_tables(&mut self) -> JsonValue

Source

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

Source

pub fn backups(&mut self, filename: &str) -> bool

Source

pub fn delete(&mut self) -> JsonValue

Source

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

Source

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

Source

pub fn transaction(&mut self) -> bool

Source

pub fn commit(&mut self) -> bool

Source

pub fn rollback(&mut self) -> bool

Source

pub fn sql(&mut self, sql: &str) -> Result<JsonValue, String>

Source

pub fn sql_execute(&mut self, sql: &str) -> Result<JsonValue, String>

Source

pub fn inc(&mut self, field: &str, num: f64) -> &mut Self

自增

Source

pub fn dec(&mut self, field: &str, num: f64) -> &mut Self

自减

Source

pub fn buildsql(&mut self) -> String

Source

pub fn join( &mut self, table: &str, main_fields: &str, right_fields: &str, ) -> &mut Self

连接

  • table 表名
  • field 本表关联字段名
Source

pub fn join_inner( &mut self, table: &str, main_fields: &str, second_fields: &str, ) -> &mut Self

内连接–用来取交集

  • table 链表表名
  • main_fields 主表字段
  • second_fields 附表关联字段

Trait Implementations§

Source§

impl Clone for Db

Source§

fn clone(&self) -> Db

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Db

§

impl RefUnwindSafe for Db

§

impl Send for Db

§

impl Sync for Db

§

impl Unpin for Db

§

impl UnwindSafe for Db

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.