Struct cfx_storage::KvdbSqliteStatements
source · pub struct KvdbSqliteStatements {
pub stmts_main_table: KvdbSqliteStatementsPerTable,
pub stmts_bytes_key_table: KvdbSqliteStatementsPerTable,
}
Fields§
§stmts_main_table: KvdbSqliteStatementsPerTable
§stmts_bytes_key_table: KvdbSqliteStatementsPerTable
When numbered key is turned off, the bytes_key_table is the same as the main table.
Implementations§
source§impl KvdbSqliteStatements
impl KvdbSqliteStatements
pub const BYTES_KEY_TABLE_SUFFIX: &'static str = "_bytes_key"
pub const CREATE_TABLE_BLOB_KV_STATEMENT_TMPL: &'static str = "CREATE TABLE IF NOT EXISTS {table_name} ( key BLOB PRIMARY KEY {comma_value_columns_def} ) WITHOUT ROWID"
pub const CREATE_TABLE_NUMBER_KV_STATEMENT_TMPL: &'static str = "CREATE TABLE IF NOT EXISTS {table_name} ( key INTEGER PRIMARY KEY {comma_value_columns_def} )"
pub const DELETE_STATEMENT: &'static str = "DELETE FROM {table_name} where key = :key"
pub const DROP_TABLE_STATEMENT: &'static str = "DROP TABLE IF EXISTS {table_name}"
pub const GET_STATEMENT_TMPL: &'static str = "SELECT {value_columns} FROM {table_name} WHERE key = :key"
pub const PUT_STATEMENT_TMPL: &'static str = "INSERT OR REPLACE INTO {table_name} VALUES (:key {comma_value_columns_to_bind})"
pub const RANGE_EXCL_SELECT_STATEMENT: &'static str = "SELECT key {comma_value_columns} FROM {table_name} \ WHERE key > :lower_bound_excl AND key < :upper_bound_excl ORDER BY key ASC"
pub const RANGE_SELECT_STATEMENT: &'static str = "SELECT key {comma_value_columns} FROM {table_name} \ WHERE key >= :lower_bound_incl AND key < :upper_bound_excl ORDER BY key ASC"
pub const RANGE_SELECT_STATEMENT_TILL_END: &'static str = "SELECT key {comma_value_columns} FROM {table_name} \ WHERE key >= :lower_bound_incl ORDER BY key ASC"
pub const SELECT_TBL_NAME: &'static str = "SELECT tbl_name FROM sqlite_master WHERE tbl_name = \"{table_name}\" AND type = \"table\""
pub const VACUUM: &'static str = "vacuum"
pub fn make_statements( value_column_names: &[&str], value_column_types: &[&str], main_table_name: &str, with_number_key_table: bool ) -> Result<Self>
Trait Implementations§
source§impl Clone for KvdbSqliteStatements
impl Clone for KvdbSqliteStatements
source§fn clone(&self) -> KvdbSqliteStatements
fn clone(&self) -> KvdbSqliteStatements
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for KvdbSqliteStatements
impl Send for KvdbSqliteStatements
impl Sync for KvdbSqliteStatements
impl Unpin for KvdbSqliteStatements
impl UnwindSafe for KvdbSqliteStatements
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