Interface Admin
access this type via: data.qdb.Admin (provides, requires or uses)
This is a simple administration interface for QDB, with common helper functions.
Functions
bool init(char host[], int port, NewTableSpec tables[])
String[] refactor(char hostA[], int portA, char hostB[], int portB, NewTableSpec newTables[], optional TableMap tableMap[], bool dryRun)
bool init(char host[], int port, NewTableSpec tables[])
Initialise an empty database with tables. This operation will fail if the database is not empty.
host The host endpoint of the database.
port The port number at which the database is hosted.
returns: True if successful, false otherwise.
String[] refactor(char hostA[], int portA, char hostB[], int portB, NewTableSpec newTables[], optional TableMap tableMap[], bool dryRun)
Refactor the structure of an existing database into a new empty one, copying data into the new structure. The new database must be empty.
hostA The host endpoint of the existing database.
portA The port number at which the existing database is hosted.
hostB The host endpoint of the new database.
portB The port number at which the new database is hosted.
newTables The list of new tables to populate the new database with. By default, table contents are copied by matching table names against those in the existing database. New tables should normally have all the same fields as the corresponding existing tables, but may have extra fields. Tables from the existing database that are not present in the new table list are not copied over. The way in which data is mapped between tables and fields can be controlled using the optional tableMap parameter.
tableMap Special instructions on how to map the data in differently-named tables or fields to one another.
dryRun If true, no changes are made in either database.
returns: The list of fields for which data was not copied to the new database, indicating that this data will potentially be lost if the existing database is deleted.