Next: Table Functions, Previous: Data Access, Up: Top [Index]
database database(void);
is a new database
void db_cache(database db, integer size);
set the maximum cache size db database to size * 65536 bytes. The limit applies only to unmodified blocks (b-tree nodes and large keys and data pages).
void db_close(database db);
closes the db database. All the associated tables are closed.
void db_fashion(database db, integer s);
adds s to the db database flags set.
See Database Open Definitions.
void db_flush(database db);
writes changes to the disk store.
void db_messages(database db, text path);
sets the path to the nonblonde message log. No messages are written for a void path (the default value). The function only has effect if called before ‘db_open’*.
database db_open(database db, text path); database db_open2(database db, text path, integer cache);
are db, open db for the database store indicated by path. If the disk store does not exist, it is created.
cache indicates the desired maximal size of the cached b-tree node data in 64 kilobytes increments. The actual cached size will exceed the indicated amount when in memory changes reserve a larger combined b-tree node data size. The limit does not apply to the total reserved memory, including allocation padding, supporting data structures, etc.
Having a data store opened multiple times simultaneously will likely have the result of irreparably corrupting it.
void db_refine(database db, integer s);
removes s from the db database flags set.
See Database Open Definitions.
void db_remap(database db);
compacts the page map of the db database.
void db_remove(text path);
removes the database at path.
integer db_restore(database db, integer store);
is the combined size of high file offset blocks in the data store of the db database the function moves to lower file offsets. It will not exceed store if more than one block was moved, and it is expressed in 64 kilobytes units, same as store.
void db_sync(database db);
asks the operating system to flush its cache of the database files on disk (calls fdatasync(2) on the opened database files).
table db_table(database db, text name);
is a new table object, opened for the db table indicated by the 8 characters long name (same as ‘table’().‘keep’(db, name)).
list db_tables(database db);
is the list of the db table names.
Next: Table Functions, Previous: Data Access, Up: Top [Index]