kexi
KexiDB Namespace Reference
Detailed Description
Kexi database backend drivers.
- Author:
- Adam Pigg <adam@piggz.co.uk>
Classes | |
class | Connection |
Provides database connection, allowing queries and data modification. 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 | DriverManager |
Database driver management, e.g. finding and loading drivers. More... | |
class | MySqlConnection |
class | MySqlCursor |
class | MySqlDriver |
MySQL database driver. More... | |
class | MySqlPreparedStatement |
class | pqxxTransactionData |
class | pqxxSqlConnection |
class | pqxxSqlCursor |
class | pqxxSqlDriver |
PostgreSQL database driver. More... | |
class | pqxxPreparedStatement |
class | SQLiteConnection |
sqlite-specific connection More... | |
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 | VariableExpr |
variables like fieldname or tablename.fieldname More... | |
class | FunctionExpr |
aggregation functions like SUM, COUNT, MAX, . More... | |
class | Field |
Meta-data for a field. More... | |
class | FieldList |
class | IndexSchema |
Provides information about database index that can be created for a database table. More... | |
class | MessageTitle |
class | MessageHandler |
class | Object |
class | ParserError |
class which contains detailed i18n'ed error description More... | |
class | Parser |
Parser for sql statements. More... | |
class | PreparedStatement |
Prepared database command for optimizing sequences of multiple database actions. More... | |
class | QueryColumnInfo |
class | QuerySchema |
class | QueryAsterisk |
class | Record |
class | Relationship |
class | RowEditBuffer |
class | SchemaData |
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 |
typedef QValueList< uint > | TypeGroupList |
Enumerations | |
enum | ObjectTypes { UnknownObjectType = -1, AnyObjectType = 0, TableObjectType = 1, QueryObjectType = 2, LastObjectType = 2, KexiDBSystemTableObjectType = 128, IndexObjectType = 256 } |
enum | SetFieldNameIfNoTableNameOptions { FailIfNoTableOrFieldName = 0, SetFieldNameIfNoTableName = 1 } |
Functions | |
KEXI_DB_EXPORT QString | exprClassName (int c) |
int | versionMajor () |
int | versionMinor () |
const TypeGroupList | typesForGroup (KexiDB::Field::TypeGroup typeGroup) |
QStringList | typeNamesForGroup (KexiDB::Field::TypeGroup typeGroup) |
QStringList | typeStringsForGroup (KexiDB::Field::TypeGroup typeGroup) |
KexiDB::Field::Type | defaultTypeForGroup (KexiDB::Field::TypeGroup typeGroup) |
void | getHTMLErrorMesage (Object *obj, QString &msg, QString &details) |
void | getHTMLErrorMesage (Object *obj, QString &msg) |
void | getHTMLErrorMesage (Object *obj, ResultInfo *result) |
int | idForObjectName (Connection &conn, const QString &objName, int objType) |
void | connectionTestDialog (QWidget *parent, const KexiDB::ConnectionData &data, KexiDB::MessageHandler &msgHandler) |
int | rowCount (const TableSchema &tableSchema) |
int | rowCount (KexiDB::QuerySchema &querySchema) |
int | rowCount (KexiDB::TableOrQuerySchema &tableOrQuery) |
int | fieldCount (KexiDB::TableOrQuerySchema &tableOrQuery) |
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, SetFieldNameIfNoTableNameOptions option) |
KEXI_DB_EXPORT bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval) |
KEXI_DB_EXPORT bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, const QString &keyval) |
KEXI_DB_EXPORT bool | deleteRow (Connection &conn, TableSchema *table, const QString &keyname, int keyval) |
KEXI_DB_EXPORT bool | deleteRow (Connection &conn, const QString &tableName, const QString &keyname, int keyval) |
KEXI_DB_EXPORT 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) |
KEXI_DB_EXPORT bool | replaceRow (Connection &conn, TableSchema *table, const QString &keyname, const QString &keyval, const QString &valname, QVariant val, int ftype) |
bool | isEmptyValue (KexiDB::Field *f, const QVariant &v) |
KEXI_DB_EXPORT QString | sqlWhere (KexiDB::Driver *drv, KexiDB::Field::Type t, const QString fieldName, const QVariant value) |
Variables | |
static bool | _dummy |
Typedef Documentation
typedef QValueVector<QVariant> KexiDB::RowData |
structure for storing single record with type information
Definition at line 46 of file connection.h.
Enumeration Type Documentation
enum KexiDB::ObjectTypes |
Used in splitToTableAndFieldParts().
- Enumerator:
-
FailIfNoTableOrFieldName default value for splitToTableAndFieldParts() SetFieldNameIfNoTableName - See also:
- splitToTableAndFieldParts()
Definition at line 226 of file kexidb/utils.h.
Function Documentation
KEXI_DB_EXPORT int KexiDB::versionMajor | ( | ) |
Returns the major number of Kexi's version, e.g.
- Returns:
- KexiDB version info (most significant part)
Definition at line 24 of file global.cpp.
KEXI_DB_EXPORT int KexiDB::versionMinor | ( | ) |
Returns the minor number of Kexi's version, e.g.
- Returns:
- KexiDB version info (least significant part)
Definition at line 29 of file global.cpp.
KEXI_DB_EXPORT const TypeGroupList KexiDB::typesForGroup | ( | KexiDB::Field::TypeGroup | typeGroup | ) |
KEXI_DB_EXPORT QStringList KexiDB::typeNamesForGroup | ( | KexiDB::Field::TypeGroup | typeGroup | ) |
- Returns:
- list of i18n'd type names for type group typeGroup.
Definition at line 85 of file kexidb/utils.cpp.
KEXI_DB_EXPORT QStringList KexiDB::typeStringsForGroup | ( | KexiDB::Field::TypeGroup | typeGroup | ) |
- Returns:
- list of (not-i18n'd) type names for type group typeGroup.
Definition at line 92 of file kexidb/utils.cpp.
KEXI_DB_EXPORT KexiDB::Field::Type KexiDB::defaultTypeForGroup | ( | KexiDB::Field::TypeGroup | typeGroup | ) |
- Returns:
- default field type for type group typeGroup, for example, Field::Integer for Field::IntegerGroup. It is used e.g. in KexiAlterTableDialog, to properly fill 'type' property when user selects type group for a field.
Definition at line 99 of file kexidb/utils.cpp.
KEXI_DB_EXPORT void KexiDB::getHTMLErrorMesage | ( | Object * | obj, | |
QString & | msg, | |||
QString & | details | |||
) |
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 occured. msg and details strings are not overwritten. If msg is not empty, obj's error message is appended to details.
Definition at line 106 of file kexidb/utils.cpp.
KEXI_DB_EXPORT void KexiDB::getHTMLErrorMesage | ( | Object * | obj, | |
QString & | msg | |||
) |
This methods works like above, but appends both a message and a description to msg.
Definition at line 162 of file kexidb/utils.cpp.
KEXI_DB_EXPORT void KexiDB::getHTMLErrorMesage | ( | Object * | obj, | |
ResultInfo * | result | |||
) |
This methods works like above, but works on result's members instead.
Definition at line 167 of file kexidb/utils.cpp.
KEXI_DB_EXPORT int KexiDB::idForObjectName | ( | Connection & | conn, | |
const QString & | objName, | |||
int | objType | |||
) |
- Returns:
- identifier for object objName of type objType or 0 if such object does not exist.
Definition at line 172 of file kexidb/utils.cpp.
KEXI_DB_EXPORT void KexiDB::connectionTestDialog | ( | QWidget * | parent, | |
const KexiDB::ConnectionData & | data, | |||
KexiDB::MessageHandler & | msgHandler | |||
) |
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.
Definition at line 461 of file kexidb/utils.cpp.
KEXI_DB_EXPORT int KexiDB::rowCount | ( | const TableSchema & | tableSchema | ) |
- Returns:
- a number of rows that can be retrieved from tableSchema. The table must be created or retrieved using a Connection object, i.e. tableSchema.connection() must not return 0. For SQL sata sources it does not fetch any records, only "COUNT()" SQL aggregation is used at the backed. -1 is returned if error occured.
Definition at line 468 of file kexidb/utils.cpp.
KEXI_DB_EXPORT int KexiDB::rowCount | ( | QuerySchema & | querySchema | ) |
Like above but operates on a query schema.
Definition at line 484 of file kexidb/utils.cpp.
KEXI_DB_EXPORT int KexiDB::rowCount | ( | TableOrQuerySchema & | tableOrQuery | ) |
Like above but operates on a table or query schema variant.
Definition at line 500 of file kexidb/utils.cpp.
KEXI_DB_EXPORT int KexiDB::fieldCount | ( | TableOrQuerySchema & | tableOrQuery | ) |
- Returns:
- a number of columns that can be retrieved from table or query schema. In case of query, expanded fields are counted. Can return -1 if tableOrQuery has neither table or query assigned.
Definition at line 509 of file kexidb/utils.cpp.
KEXI_DB_EXPORT QMap< QString, QString > KexiDB::toMap | ( | const ConnectionData & | data | ) |
Saves connection data data into map.
Definition at line 518 of file kexidb/utils.cpp.
KEXI_DB_EXPORT void KexiDB::fromMap | ( | const QMap< QString, QString > & | map, | |
ConnectionData & | data | |||
) |
Restores connection data data from map.
Definition at line 535 of file kexidb/utils.cpp.
KEXI_DB_EXPORT bool KexiDB::splitToTableAndFieldParts | ( | const QString & | string, | |
QString & | tableName, | |||
QString & | fieldName, | |||
SetFieldNameIfNoTableNameOptions | option = FailIfNoTableOrFieldName | |||
) |
Splits string like "table.field" into "table" and "field" parts. On success, a table name is passed to tableName and a field name is passed to fieldName. The function fails if either:
- string is empty, or
- string does not contain '.' character and option is FailIfNoTableOrFieldName (the default), or
- '.' character is the first of last character of string (in this case table name or field name could become empty what is not allowed).
If option is SetFieldNameIfNoTableName and string does not contain '.', string is passed to fieldName and tableName is set to QString::null without failure.
If function fails, tableName and fieldName remain unchanged.
- Returns:
- true on success.
Definition at line 550 of file kexidb/utils.cpp.
KEXI_DB_EXPORT bool KexiDB::deleteRow | ( | Connection & | conn, | |
TableSchema * | table, | |||
const QString & | keyname, | |||
const QString & | keyval | |||
) | [inline] |
KEXI_DB_EXPORT bool KexiDB::deleteRow | ( | Connection & | conn, | |
const QString & | tableName, | |||
const QString & | keyname1, | |||
Field::Type | keytype1, | |||
const QVariant & | keyval1, | |||
const QString & | keyname2, | |||
Field::Type | keytype2, | |||
const QVariant & | keyval2 | |||
) | [inline] |
Delete row with two generic criterias.
Definition at line 62 of file kexidb/utils.h.
bool KexiDB::isEmptyValue | ( | KexiDB::Field * | f, | |
const QVariant & | v | |||
) | [inline] |
- Returns:
- true if v represents an empty (but not null) value. Values of some types (as for strings) can be both empty and not null.
Definition at line 98 of file kexidb/utils.h.
KEXI_DB_EXPORT QString KexiDB::sqlWhere | ( | KexiDB::Driver * | drv, | |
KexiDB::Field::Type | t, | |||
const QString | fieldName, | |||
const QVariant | value | |||
) | [inline] |
Function useful for building WHERE parts of sql statements. Constructs an sql string like "fielname = value" for specific drv driver, field type t, fieldName and value. If value is null, "fieldname is NULL" string is returned.
Definition at line 123 of file kexidb/utils.h.
Variable Documentation
bool KexiDB::_dummy [static] |
QAsciiDict keys need to be a pointer to *something*. Used for SQL keyword dictionaries
Definition at line 34 of file driver_p.cpp.