KexiDB Namespace Reference
Detailed Description
High-level database connectivity library with database backend drivers.
- Author:
- Jaroslaw Staniek <js@iidea.pl>
Framework
DriverManagerDatabase access
Database structure
- Schema
- tableschema
- queryschema
- indexschema
Stored in the database.
Data representation
Drivers
Drivers are loaded using DriverManager::driver(const QString& name). The names of drivers are given in their drivers .desktop file in the X-Kexi-DriverName field.KexiDB supports two kinds of databases: file-based and network-based databases. The type of a driver is available from several places. The X-Kexi-DriverType field in the driver's .desktop file, is read by the DriverManager and available by calling DriverManager::driverInfo(const QString &name) and using the Driver::Info::fileBased member from the result. Given a reference to a Driver, its type can also be found directly using Driver::isFileDriver() const.
Each database backend driver consists of three main classes: a driver, a connection and a cursor class, e.g SQLiteDriver, SQLiteConnection, SQLiteCursor.
The driver classes subclass the Driver class. They set Driver#m_typeNames, which maps KexiDB's Field::Type on to the types supported by the database. They also provide functions for escaping strings and checking table names. These may be used, for example, on a database backend that uses the database name as a filename. In this case, it should be ensured that all the characters in the database name are valid characters in a filename.
The connection classes subclass the Connection class, and include most of the calls to the native database API.
The cursor classes subclass Cursor, and implement cursor functionality specific to the database backend.
Classes | |
| class | AdminTools |
| An interface containing a set of tools for database administration. More... | |
| class | AlterTableHandler |
| A tool for handling altering database table schema. More... | |
| class | Connection |
| Provides database connection, allowing queries and data modification. More... | |
| class | ConnectionInternal |
| Interface for connection's internals, implemented within drivers. More... | |
| class | ConnectionDataBase |
| class | ConnectionData |
| Database specific connection data, e.g. host, port. More... | |
| class | Cursor |
| Provides database cursor functionality. More... | |
| class | ObjectNameValidator |
| class | DatabaseProperties |
| A set of storable database properties. More... | |
| class | Driver |
| Generic database abstraction. More... | |
| class | DriverBehaviour |
| class | DriverPrivate |
| class | DriverManager |
| Database driver management, e.g. finding and loading drivers. More... | |
| class | DriverManagerInternal |
| class | MySqlConnection |
| class | MySqlCursor |
| class | MySqlDriver |
| MySQL database driver. More... | |
| class | MySqlPreparedStatement |
| class | pqxxTransactionData |
| class | pqxxSqlConnection |
| class | pqxxSqlConnectionInternal |
| class | pqxxSqlCursor |
| class | pqxxSqlDriver |
| PostgreSQL database driver. More... | |
| class | pqxxPreparedStatement |
| class | SQLiteConnection |
| sqlite-specific connection More... | |
| class | SQLiteConnectionInternal |
| class | SQLiteCursor |
| class | SQLiteDriver |
| SQLite database driver. More... | |
| class | SQLitePreparedStatement |
| class | ResultInfo |
| class | BaseExpr |
| A base class for all expressions. More... | |
| class | NArgExpr |
| A base class N-argument operation. More... | |
| class | UnaryExpr |
| An unary argument operation: + - NOT (or !) ~ "IS NULL" "IS NOT NULL". More... | |
| class | BinaryExpr |
| class | ConstExpr |
| class | QueryParameterExpr |
| Query parameter used to getting user input of constant values. More... | |
| class | VariableExpr |
| Variables like fieldname or tablename.fieldname. More... | |
| class | FunctionExpr |
| |
| class | Field |
| Meta-data for a field. More... | |
| class | FieldList |
| class | FieldValidator |
| A validator for KexiDB data types. More... | |
| class | DatabaseVersionInfo |
| Contains database version information about a Kexi-compatible database. The version is stored as internal database properties. More... | |
| class | ServerVersionInfo |
| Contains version information about a database backend. More... | |
| class | IndexSchema |
| Provides information about database index that can be created for a database table. More... | |
| class | LookupFieldSchema |
| Provides information about lookup field's setup. More... | |
| class | MessageTitle |
| class | MessageHandler |
| class | Object |
| class | ParserError |
| Provides detailed i18n'ed error description about the Parser . More... | |
| class | Parser |
| Parser for SQL statements. More... | |
| class | ParserPrivate |
| class | ParseInfo |
| class | PreparedStatement |
| Prepared database command for optimizing sequences of multiple database actions. More... | |
| class | QueryColumnInfo |
| Helper class that assigns additional information for the column in a query. More... | |
| class | OrderByColumn |
| KexiDB::OrderByColumn provides information about a single query column used for sorting. More... | |
| class | OrderByColumnList |
| KexiDB::OrderByColumnList provides list of sorted columns for a query schema. More... | |
| class | QuerySchema |
| KexiDB::QuerySchema provides information about database query. More... | |
| class | QueryAsterisk |
| KexiDB::QueryAsterisk class encapsulates information about single asterisk in query definition. More... | |
| class | QuerySchemaParameter |
| A single parameter of a query schema. More... | |
| class | QuerySchemaParameterValueListIterator |
| An iteratof for a list of values of query schema parameters providing Allows to iterate over parameters and return QVariant value or well-formatted string. More... | |
| class | Record |
| class | Relationship |
| class | RowEditBuffer |
| provides data for single edited database row KexiDB::RowEditBuffer provides data for single edited row, needed to perform update at the database backend. Its advantage over pasing e.g. KexiDB::FieldList object is that EditBuffer contains only changed values. More... | |
| class | SchemaData |
| class | SimpleCommandLineApp |
| A skeleton for creating a simple command line database application. More... | |
| class | TableSchema |
| class | InternalTableSchema |
| class | TransactionData |
| class | Transaction |
| This class encapsulates transaction handle. More... | |
| class | TransactionGuard |
| Helper class for using inside methods for given connection. More... | |
| class | TableOrQuerySchema |
Typedefs | |
| typedef QValueVector< QVariant > | RowData |
| structure for storing single record with type information | |
| typedef QValueList< QuerySchemaParameter > | QuerySchemaParameterList |
| typedef QValueList< OrderByColumn > | OrderByColumnListBase |
| A base for KexiDB::OrderByColumnList. | |
| typedef QValueList< QuerySchemaParameter >::Iterator | QuerySchemaParameterListIterator |
| typedef QValueList< QuerySchemaParameter >::ConstIterator | QuerySchemaParameterListConstIterator |
| typedef QValueList< uint > | TypeGroupList |
Enumerations | |
| enum | ObjectTypes { UnknownObjectType = -1, AnyObjectType = 0, TableObjectType = 1, QueryObjectType = 2, LastObjectType = 2, KexiDBSystemTableObjectType = 128, IndexObjectType = 256 } |
| enum | SplitToTableAndFieldPartsOptions { FailIfNoTableOrFieldName = 0, SetFieldNameIfNoTableName = 1 } |
| Used in splitToTableAndFieldParts(). More... | |
| enum | BLOBEscapingType { BLOBEscapeXHex = 1, BLOBEscape0xHex, BLOBEscapeHex, BLOBEscapeOctal } |
| Escaping types used in escapeBLOB(). More... | |
Functions | |
| QVariant | pgsqlCStrToVariant (const pqxx::result::field &r) |
| QString | exprClassName (int c) |
| DatabaseVersionInfo | version () |
| Returns the encoded number of Kexi's version, see the KEXI_VERSION macro. | |
| void | debug (const QuerySchemaParameterList &list) |
| Shows debug information for list. | |
| bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval) |
| for convenience | |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, const QString &keyval) |
| bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, int keyval) |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, int keyval) |
| bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname1, Field::Type keytype1, const QVariant &keyval1, const QString &keyname2, Field::Type keytype2, const QVariant &keyval2) |
| bool | replaceRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval, const QString &valname, QVariant val, int ftype) |
| const TypeGroupList | typesForGroup (Field::TypeGroup typeGroup) |
| QStringList | typeNamesForGroup (Field::TypeGroup typeGroup) |
| QStringList | typeStringsForGroup (Field::TypeGroup typeGroup) |
| Field::Type | defaultTypeForGroup (Field::TypeGroup typeGroup) |
| bool | isEmptyValue (Field *f, const QVariant &v) |
| void | getHTMLErrorMesage (Object *obj, QString &msg, QString &details) |
| void | getHTMLErrorMesage (Object *obj, QString &msg) |
| void | getHTMLErrorMesage (Object *obj, ResultInfo *result) |
| QString | sqlWhere (Driver *drv, Field::Type t, const QString fieldName, const QVariant value) |
| int | idForObjectName (Connection &conn, const QString &objName, int objType) |
| int | rowCount (Connection &conn, const QString &sql) |
| int | rowCount (const TableSchema &tableSchema) |
| int | rowCount (QuerySchema &querySchema) |
| int | rowCount (TableOrQuerySchema &tableOrQuery) |
| int | fieldCount (TableOrQuerySchema &tableOrQuery) |
| void | connectionTestDialog (QWidget *parent, const ConnectionData &data, MessageHandler &msgHandler) |
| QMap< QString, QString > | toMap (const ConnectionData &data) |
| void | fromMap (const QMap< QString, QString > &map, ConnectionData &data) |
| bool | splitToTableAndFieldParts (const QString &string, QString &tableName, QString &fieldName, SplitToTableAndFieldPartsOptions option=FailIfNoTableOrFieldName) |
| bool | supportsVisibleDecimalPlacesProperty (Field::Type type) |
| QString | formatNumberForVisibleDecimalPlaces (double value, int decimalPlaces) |
| bool | isBuiltinTableFieldProperty (const QCString &propertyName) |
| bool | isExtendedTableFieldProperty (const QCString &propertyName) |
| Field::Type | intToFieldType (int type) |
| bool | setFieldProperties (Field &field, const QMap< QCString, QVariant > &values) |
| bool | setFieldProperty (Field &field, const QCString &propertyName, const QVariant &value) |
| QVariant | loadPropertyValueFromDom (const QDomNode &node) |
| int | loadIntPropertyValueFromDom (const QDomNode &node, bool *ok) |
| QString | loadStringPropertyValueFromDom (const QDomNode &node, bool *ok) |
| QDomElement | saveNumberElementToDom (QDomDocument &doc, QDomElement &parentEl, const QString &elementName, int value) |
| QDomElement | saveBooleanElementToDom (QDomDocument &doc, QDomElement &parentEl, const QString &elementName, bool value) |
| QVariant | emptyValueForType (Field::Type type) |
| QVariant | notEmptyValueForType (Field::Type type) |
| QString | escapeBLOB (const QByteArray &array, BLOBEscapingType type) |
| QByteArray | pgsqlByteaToByteArray (const char *data, int length) |
| QString | variantToString (const QVariant &v) |
| QVariant | stringToVariant (const QString &s, QVariant::Type type, bool &ok) |
| bool | isDefaultValueAllowed (Field *field) |
| void | getLimitsForType (Field::Type type, int &minValue, int &maxValue) |
| void | debugRowData (const RowData &rowData) |
| Field::Type | maximumForIntegerTypes (Field::Type t1, Field::Type t2) |
| QVariant | cstringToVariant (const char *data, KexiDB::Field *f, int length=-1) |
Variables | |
| static bool | _dummy |
Typedef Documentation
|
|
A base for KexiDB::OrderByColumnList.
Definition at line 153 of file queryschema.h. |
|
|
Definition at line 38 of file queryschema.h. |
|
|
Definition at line 43 of file queryschemaparameter.h. |
|
|
Definition at line 42 of file queryschemaparameter.h. |
|
|
structure for storing single record with type information
Definition at line 47 of file connection.h. |
|
|
Definition at line 86 of file kexidb/utils.h. |
Enumeration Type Documentation
|
|
Escaping types used in escapeBLOB().
Definition at line 379 of file kexidb/utils.h. |
|
|
Object types set like table or query. |
|
|
Used in splitToTableAndFieldParts().
Definition at line 262 of file kexidb/utils.h. |
Function Documentation
|
||||||||||||||||
|
shows connection test dialog with a progress bar indicating connection testing (within a second thread). data is used to perform a (temporary) test connection. msgHandler is used to display errors. On successful connecting, a message is displayed. After testing, temporary connection is closed. Referenced by KexiDBConnectionTabWidget::slotTestConnection(). |
|
||||||||||||||||
|
Definition at line 437 of file kexidb/utils.h. References KexiDB::Field::BigInteger, KexiDB::Field::BLOB, KexiDB::Field::isFPNumericType(), KexiDB::Field::isIntegerType(), KexiDB::Field::isTextType(), KexiDB::Field::type(), and KexiDB::Field::variantType(). Referenced by KexiMigration::PqxxMigrate::drv_copyTable(), KexiMigration::MySQLMigrate::drv_copyTable(), KexiDB::MySqlCursor::storeCurrentRow(), and KexiDB::MySqlCursor::value(). |
|
|
Shows debug information for list.
Referenced by KexiQueryView::executeQuery(). |
|
|
Shows debug information about rowData row data. |
|
|
Referenced by KexiTableDesignerView::slotBeforeCellChanged(), and KexiTableDesignerView::slotRowUpdated(). |
|
||||||||||||||||||||||||||||||||||||
|
Delete row with two generic criterias. Definition at line 66 of file kexidb/utils.h. |
|
||||||||||||||||||||
|
Definition at line 58 of file kexidb/utils.h. References KexiDB::Field::Integer. |
|
||||||||||||||||||||
|
Definition at line 51 of file kexidb/utils.h. References KexiDB::Field::Integer, and KexiDB::SchemaData::name(). |
|
||||||||||||||||||||
|
Definition at line 44 of file kexidb/utils.h. References KexiDB::Field::Text. |
|
||||||||||||||||||||
|
for convenience
Definition at line 37 of file kexidb/utils.h. References KexiDB::Connection::driver(), KexiDB::Connection::executeSQL(), KexiDB::SchemaData::name(), and KexiDB::Field::Text. Referenced by KexiDB::Connection::createTable(), KexiDB::Connection::dropTable(), KexiDB::Connection::removeDataBlock(), KexiDB::Connection::removeObject(), and replaceRow(). |
|
|
Referenced by KexiDB::AlterTableHandler::execute(), and KexiDB::notEmptyValueForType(). |
|
||||||||||||
|
Referenced by KexiDB::SQLiteDriver::escapeBLOB(), KexiDB::pqxxSqlDriver::escapeBLOB(), KexiDB::MySqlDriver::escapeBLOB(), KexiCSVExport::exportData(), and KexiDB::variantToString(). |
|
|
Referenced by KexiDB::BinaryExpr::debugString(), and KexiDB::NArgExpr::debugString(). |
|
|
Referenced by KexiDB::PreparedStatement::generateStatementString(), and KexiCSVExportWizard::showPage(). |
|
||||||||||||
|
Referenced by KexiTableEdit::setupContents(), and KexiTextFormatter::valueToText(). |
|
||||||||||||
|
Restores connection data data from map. |
|
||||||||||||
|
This methods works like above, but works on result's members instead. |
|
||||||||||||
|
This methods works like above, but appends both a message and a description to msg. |
|
||||||||||||||||
|
Sets msg to an error message retrieved from object obj, and details to details of this error (server message and result number). Does nothing if obj is null or no error occurred. msg and details strings are not overwritten. If msg is not empty, obj's error message is appended to details. Referenced by KexiTableViewData::deleteRow(), KexiDB::getHTMLErrorMesage(), KexiTableViewData::saveRow(), KexiBrowser::setProject(), and KexiGUIMessageHandler::showErrorMessage(). |
|
||||||||||||||||
|
Gets limits for values of type type. The result is put into minValue and maxValue. Supported types are Byte, ShortInteger, Integer and BigInteger Results for BigInteger or non-integer types are the same as for Integer due to limitation of int type. Signed integers are assumed.
Referenced by KexiQueryParameters::getParameters(). |
|
||||||||||||||||
|
Referenced by KexiDBSubForm::setFormName(), and KexiSubReport::setReportName(). |
|
|
Referenced by KexiTableDesignerView::buildField(), KexiDB::SQLiteConnection::drv_changeFieldProperty(), setIntToFieldType(), KexiTableDesignerView::slotPropertyChanged(), and KexiTableDesignerView::slotRowUpdated(). |
|
|
Referenced by KexiDB::setFieldProperties(). |
|
|
Referenced by KexiDB::RowEditBuffer::at(), and KexiDB::Connection::insertRow(). |
|
||||||||||||
|
Definition at line 105 of file kexidb/utils.h. References KexiDB::Field::hasEmptyProperty(). Referenced by KexiTableViewData::saveRow(). |
|
|
Referenced by KexiDB::setFieldProperties(), and KexiDB::setFieldProperty(). |
|
||||||||||||
|
Convenience version of loadPropertyValueFromDom().
Referenced by KexiDB::Connection::loadExtendedTableSchemaData(). |
|
|
Referenced by KexiDB::Connection::loadExtendedTableSchemaData(), and KexiDB::LookupFieldSchema::loadFromDom(). |
|
||||||||||||
|
Convenience version of loadPropertyValueFromDom().
|
|
||||||||||||
|
Referenced by KexiDB::maximumForIntegerTypes(), and KexiDB::BinaryExpr::type(). |
|
|
Referenced by KexiDB::AlterTableHandler::execute(). |
|
||||||||||||
|
Referenced by KexiMigration::PqxxMigrate::drv_copyTable(), pgsqlByteaToByteArray(), and pgsqlCStrToVariant(). |
|
|
Definition at line 77 of file pqxxcursor.h. References BOOLOID, BPCHAROID, BYTEAOID, DATEOID, FLOAT4OID, FLOAT8OID, INT2OID, INT4OID, INT8OID, NUMERICOID, pgsqlByteaToByteArray(), TEXTOID, TIMEOID, TIMESTAMPOID, and VARCHAROID. Referenced by KexiMigration::PqxxMigrate::drv_fetchRecordFromSQL(). |
|
||||||||||||||||||||||||||||||||
|
Definition at line 75 of file kexidb/utils.h. References deleteRow(), KexiDB::SchemaData::name(), and KexiDB::Field::Text. |
|
|
Like above but operates on a table or query schema variant. |
|
|
Like above but operates on a query schema. |
|
|
|
|
||||||||||||
|
Referenced by KexiCSVExport::exportData(), KexiDB::rowCount(), and KexiCSVExportWizard::showPage(). |
|
||||||||||||||||||||
|
Saves boolean element for value value to doc document within parent element parentEl. Like saveNumberElementToDom() but creates "bool" tags. True/false values will be saved as "true"/"false" strings.
Referenced by KexiDB::LookupFieldSchema::saveToDom(). |
|
||||||||||||||||||||
|
Saves integer element for value value to doc document within parent element parentEl. The value will be enclosed in "number" element and "elementName" element. Example: saveNumberElementToDom(doc, parentEl, "height", 15) will create <height><number>15</number></height>
Referenced by KexiDB::LookupFieldSchema::saveToDom(). |
|
||||||||||||
|
Sets property values for field.
Referenced by KexiTableDesignerView::buildField(), and KexiDB::AlterTableHandler::InsertFieldAction::simplifyActions(). |
|
