#include <Database.hpp>
Inheritance diagram for Ionflux::Tools::Database:
Public Member Functions | |
Database () | |
Constructor. | |
Database (const DatabaseConfig &initConfig) | |
Constructor. | |
virtual | ~Database () |
Destructor. | |
virtual void | setConfig (const DatabaseConfig &newConfig)=0 |
Set database configuration. | |
virtual void | setConfig (Ionflux::Tools::Node &newConfig)=0 |
Set database configuration. | |
virtual DatabaseConfig | getConfig ()=0 |
Get database configuration. | |
virtual bool | connect ()=0 |
Connect to database. | |
virtual void | close ()=0 |
Close database connection. | |
virtual bool | query (const std::string &command)=0 |
Execute database query. | |
virtual bool | listTables (DbTables &tables, const std::string &pattern="")=0 |
List tables. | |
virtual bool | listColumns (DbColumns &columns, const std::string &table)=0 |
List columns. | |
virtual unsigned int | getNumRows (const std::string &table)=0 |
Get number of rows. | |
virtual unsigned int | getNumRows ()=0 |
Get number of rows returned. | |
virtual unsigned int | getNumAffectedRows ()=0 |
Get number of rows affected. | |
virtual bool | fetchRow (DbRow &row)=0 |
Get a result row. | |
virtual bool | fetchRowMap (DbRowMap &rowMap)=0 |
Get a result row as a map. | |
virtual bool | fetchRowTree (Node &rowNode)=0 |
Get a result row as a tree. | |
virtual bool | fetchResult (DbResult &result)=0 |
Get a complete result. | |
virtual bool | fetchResultMap (DbResultMap &resultMap)=0 |
Get a complete result as a map. | |
virtual bool | fetchResultTree (Node &resultNode, int nodeOrder)=0 |
Get a complete result as a tree. | |
virtual std::string | sqlEscape (const std::string &source)=0 |
Escape string. | |
virtual bool | validateTable (const std::string &tableName, const std::string &createTemplate="", Node *createConfig=0)=0 |
Validate existence of table. | |
virtual DatabaseError | getError ()=0 |
Get error. | |
Static Public Attributes | |
static const int | NODE_ORDER_ROWS = 0 |
Node order: First level represents rows. | |
static const int | NODE_ORDER_NAMED_FIELDS = 1 |
Node order: First level represents rows with named field nodes. | |
static const int | NODE_ORDER_COLUMNS = 2 |
Node order: First level represents columns. | |
static const DatabaseClassInfo | databaseClassInfo |
Class information instance. | |
static const ClassInfo * | CLASS_INFO |
Class information. |
Abstract wrapper class for a database connection.
|
Constructor. Construct new Database object. |
|
Constructor. Construct new Database object. |
|
Destructor. Destruct Database object. |
|
Close database connection.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Connect to database. Establish a database connection.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a complete result. Initializes a DbResult to contain all result rows.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a complete result as a map. Initializes a DbResultMap to contain all result rows as maps. Use this to get a complete result as maps.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a complete result as a tree. Initializes a tree node to contain all result rows. Use this to get a complete result as a tree. You can specify either Database::NODE_ORDER_ROWS, Database::NODE_ORDER_NAMED_FIELDS, or Database::NODE_ORDER_COLUMNS as 'nodeOrder'. In row order mode, each node on the first level represents a row, and each data entry contains field data. The first node contains the field names as data entries. In named field order mode, each node on the first level represents a row. Each node on the second level contains field data and has its name set to the field name. In column order mode, each node on the first level represents a column and has its name set to the corresponding field name. Each data entry contains field data for a row.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a result row. Initializes a DbRow to contain the fields of a result row.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a result row as a map. Initializes a DbRowMap to contain the fields of a result row. Use this to get a result row as a map (associative array).
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get a result row as a tree. Initializes a tree node to contain the fields of a result row. Use this to get a result row as a tree.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get database configuration. Get the database configuration currently used.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get error. Get the last error.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get number of rows affected. Get the number of rows affected by the previous query.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get number of rows returned. Get the number of rows returned by the previous query.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Get number of rows. Get the number of rows for the specified table.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
List columns. Fetches a list of columns for the specified table.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
List tables. Fetches a list of tables from the current database that match the specified pattern. Pass an empty string to match all tables.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Execute database query. Execute a database query.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Set database configuration. Set configuration options for the database.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Set database configuration. Set configuration options for the database.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Escape string. Escapes a string so it represents a valid SQL string.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Validate existence of table. Validate the existence of the table with the specified name. If the table does not exist and a create template is specified, try to create the table.
Implemented in Ionflux::Tools::MySQLDatabase. |
|
Initial value: Class information.
Reimplemented from Ionflux::Tools::ManagedObject. Reimplemented in Ionflux::Tools::MySQLDatabase. |
|
Class information instance.
|
|
Node order: First level represents columns.
|
|
Node order: First level represents rows with named field nodes.
|
|
Node order: First level represents rows.
|