pub struct Database {Show 14 fields
pub file: AccessPagedData,
pub builtins: Arc<BuiltinMap>,
pub sys_schema: Rc<Table>,
pub sys_table: Rc<Table>,
pub sys_column: Rc<Table>,
pub sys_index: Rc<Table>,
pub sys_index_col: Rc<Table>,
pub sys_function: Rc<Table>,
pub schemas: RefCell<FxHashMap<String, i64>>,
pub tables: RefCell<FxHashMap<ObjRef, Rc<Table>>>,
pub functions: RefCell<FxHashMap<ObjRef, Rc<Function>>>,
pub lastid: Cell<i64>,
pub err: Cell<bool>,
pub is_new: bool,
/* private fields */
}
Expand description
Database with SQL-like interface.
Fields§
§file: AccessPagedData
Page storage.
builtins: Arc<BuiltinMap>
Defined builtin functions.
sys_schema: Rc<Table>
§sys_table: Rc<Table>
§sys_column: Rc<Table>
§sys_index: Rc<Table>
§sys_index_col: Rc<Table>
§sys_function: Rc<Table>
§schemas: RefCell<FxHashMap<String, i64>>
Cache of loaded Schemas.
tables: RefCell<FxHashMap<ObjRef, Rc<Table>>>
Cache of loaded Tables.
functions: RefCell<FxHashMap<ObjRef, Rc<Function>>>
Cache of loaded Functions.
lastid: Cell<i64>
Last id generated by INSERT.
err: Cell<bool>
Has there been an error since last save?
is_new: bool
Is the database new?
Implementations§
source§impl Database
impl Database
sourcepub fn new(
file: AccessPagedData,
initsql: &str,
builtins: Arc<BuiltinMap>
) -> DB
pub fn new( file: AccessPagedData, initsql: &str, builtins: Arc<BuiltinMap> ) -> DB
Construct a new DB, based on the specified file. initsql is used to initialise a new database. builtins specifies the functions callable in SQL code such as SUBSTR, REPLACE etc.
sourcepub fn run(self: &DB, source: &str, tr: &mut dyn Transaction)
pub fn run(self: &DB, source: &str, tr: &mut dyn Transaction)
Run a batch of SQL.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Database
impl !Send for Database
impl !Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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