Struct rustdb::Database[][src]

pub struct Database {
Show 15 fields pub file: AccessPagedData, pub sys_schema: TablePtr, pub sys_table: TablePtr, pub sys_column: TablePtr, pub sys_index: TablePtr, pub sys_index_col: TablePtr, pub sys_function: TablePtr, pub bs: Vec<ByteStorage>, pub schemas: RefCell<HashMap<String, i64>>, pub tables: RefCell<HashMap<ObjRef, TablePtr>>, pub functions: RefCell<HashMap<ObjRef, FunctionPtr>>, pub builtins: Arc<BuiltinMap>, pub function_reset: Cell<bool>, pub lastid: Cell<i64>, pub err: Cell<bool>,
}
Expand description

Database with SQL-like interface.

Fields

file: AccessPagedData

Page storage.

sys_schema: TablePtrsys_table: TablePtrsys_column: TablePtrsys_index: TablePtrsys_index_col: TablePtrsys_function: TablePtrbs: Vec<ByteStorage>

Storage of variable length data.

schemas: RefCell<HashMap<String, i64>>tables: RefCell<HashMap<ObjRef, TablePtr>>functions: RefCell<HashMap<ObjRef, FunctionPtr>>builtins: Arc<BuiltinMap>function_reset: Cell<bool>

Flag to reset the functions cache after save.

lastid: Cell<i64>

Last id generated by INSERT.

err: Cell<bool>

Has there been an error since last save?

Implementations

Construct a new DB, based on the specified file. initsql is used to initialised a new database. builtins specifies the functions callable in SQL code such as SUBSTR, REPLACE etc.

Run a batch of SQL.

Run a batch of SQL, printing the execution time.

Save updated tables to underlying file ( or rollback if there was an error ). Returns the number of logical pages that were updated.

Get the named table.

Trait Implementations

Clear function instructions to avoid leaking memory.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.