[][src]Struct stellar_sql::component::table::Table

pub struct Table {
    pub name: String,
    pub fields: HashMap<String, Field>,
    pub primary_key: Vec<String>,
    pub foreign_key: Vec<String>,
    pub reference_table: Option<String>,
    pub reference_attr: Option<String>,
    pub rows: Vec<Row>,
    pub is_data_loaded: bool,
    pub is_dirty: bool,
    pub dirty_cursor: u32,
    pub is_delete: bool,
    is_predicate_init: bool,
    row_set: HashSet<usize>,
    pub public_key: i32,
    uuid: String,
}

Fields

name: Stringfields: HashMap<String, Field>primary_key: Vec<String>foreign_key: Vec<String>reference_table: Option<String>reference_attr: Option<String>rows: Vec<Row>is_data_loaded: boolis_dirty: booldirty_cursor: u32is_delete: boolis_predicate_init: boolrow_set: HashSet<usize>public_key: i32uuid: String

Methods

impl Table[src]

pub fn new(name: &str) -> Table[src]

pub fn load_meta(
    username: &str,
    db_name: &str,
    table_name: &str
) -> Result<Table, TableError>
[src]

Load a table with meta data

pub fn format_meta(&mut self, meta: TableMeta)[src]

format metadata into table

pub fn load_rows_data(
    &mut self,
    username: &str,
    db_name: &str
) -> Result<(), TableError>
[src]

load the particular range of rows from storage

pub fn load_all_rows_data(
    &mut self,
    username: &str,
    db_name: &str
) -> Result<(), TableError>
[src]

load the all data from storage

pub fn insert_new_field(&mut self, field: Field)[src]

pub fn insert_row(&mut self, row: Vec<(&str, &str)>) -> Result<(), TableError>[src]

insert row into the table key and value are &str, and will be formated to the right type.

pub fn get_all_rows_set(&self) -> HashSet<usize>[src]

return the set of all rows' id of the table

pub fn operator_filter_rows(
    &mut self,
    field_name: &str,
    operator: &str,
    value: &str
) -> Result<HashSet<usize>, TableError>
[src]

filter rows by the predicate and update the row_set

Note: this assume all data of rows and the predicate follow the rules, so there is no check for data type and field name.

pub fn set_row_set(&mut self, set: HashSet<usize>)[src]

set the new row set

pub fn select(
    &mut self,
    field_names: Vec<String>
) -> Result<SelectData, TableError>
[src]

select fields from rows in row_set of the table

Trait Implementations

impl Clone for Table[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Table[src]

Auto Trait Implementations

impl Send for Table

impl Sync for Table

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Erased for T