[−][src]Struct stellar_sql::component::table::Table
Fields
name: String
fields: 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: bool
is_dirty: bool
dirty_cursor: u32
is_delete: bool
is_predicate_init: bool
row_set: HashSet<usize>
public_key: i32
uuid: 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]
username: &str,
db_name: &str,
table_name: &str
) -> Result<Table, TableError>
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]
&mut self,
username: &str,
db_name: &str
) -> Result<(), TableError>
load the particular range of rows from storage
pub fn load_all_rows_data(
&mut self,
username: &str,
db_name: &str
) -> Result<(), TableError>
[src]
&mut self,
username: &str,
db_name: &str
) -> Result<(), TableError>
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]
&mut self,
field_name: &str,
operator: &str,
value: &str
) -> Result<HashSet<usize>, TableError>
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]
&mut self,
field_names: Vec<String>
) -> Result<SelectData, TableError>
select fields from rows in row_set of the table
Trait Implementations
impl Clone for Table
[src]
fn clone(&self) -> 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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.