KDb
KDbConnectionProxy.h
84 bool useDatabase(const QString &dbName = QString(), bool kexiCompatible = true, bool *cancelled = nullptr,
146 KDbCursor* executeQuery(KDbQuerySchema* query, KDbCursor::Options options = KDbCursor::Option::None);
148 KDbCursor* executeQuery(KDbTableSchema* table, KDbCursor::Options options = KDbCursor::Option::None);
368 bool updateRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool useRecordId = false);
370 bool insertRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool getRecordId = false);
Database specific connection data, e.g. host, port.
Definition KDbConnectionData.shared.h:36
Generic options for a single connection. The options are accessible using key/value pairs....
Definition KDbConnectionOptions.h:36
The KDbConnectionProxy class gives access to protected (low-level) API of KDbConnection.
Definition KDbConnectionProxy.h:37
Provides database connection, allowing queries and data modification.
Definition KDbConnection.h:52
bool updateRecord(KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
Definition KDbConnection.cpp:3098
virtual KDbEscapedString escapeString(const QString &str) const
Definition KDbConnection.cpp:3535
tristate loadObjectData(int type, int id, KDbObject *object)
Definition KDbConnection.cpp:2224
tristate loadDataBlock(int objectID, QString *dataString, const QString &dataID=QString())
Definition KDbConnection.cpp:2933
KDbField * setupField(const KDbRecordData &data)
Definition KDbConnection.cpp:2855
virtual bool drv_setAutoCommit(bool on)
Definition KDbConnection.cpp:2127
KDbTableSchema * copyTable(const KDbTableSchema &tableSchema, const KDbObject &newData)
Definition KDbConnection.cpp:1519
bool databaseExists(const QString &dbName, bool ignoreErrors=true)
Definition KDbConnection.cpp:630
bool queryStringList(const KDbEscapedString &sql, QStringList *list, int column=0)
Definition KDbConnection.cpp:2539
bool removeDataBlock(int objectID, const QString &dataID=QString())
Definition KDbConnection.cpp:2992
virtual bool drv_closeDatabase()=0
virtual KDbPreparedStatementInterface * prepareStatementInternal()=0
bool storeMainFieldSchema(KDbField *field)
Definition KDbConnection.cpp:1363
void setAvailableDatabaseName(const QString &dbName)
Definition KDbConnection.cpp:3073
bool setQuerySchemaObsolete(const QString &queryName)
Definition KDbConnection.cpp:3035
KDbProperties databaseProperties() const
Definition KDbConnection.cpp:1059
KDbPreparedStatement prepareStatement(KDbPreparedStatement::Type type, KDbFieldList *fields, const QStringList &whereFieldNames=QStringList())
Definition KDbConnection.cpp:3521
bool commitAutoCommitTransaction(const KDbTransaction &trans)
Definition KDbConnection.cpp:1924
tristate querySingleString(const KDbEscapedString &sql, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2439
virtual bool drv_getServerVersion(KDbServerVersionInfo *version)=0
KDbCursor * executeQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)
Definition KDbConnection.cpp:2132
virtual bool drv_alterTableName(KDbTableSchema *tableSchema, const QString &newName)
Definition KDbConnection.cpp:1798
bool closeDatabase()
Closes currently used database for this connection.
Definition KDbConnection.cpp:852
virtual bool drv_isDatabaseUsed() const
Definition KDbConnection.h:1159
virtual bool drv_executeSql(const KDbEscapedString &sql)=0
Executes query for a raw SQL statement sql without returning resulting records.
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)=0
void setDefaultTransaction(const KDbTransaction &trans)
Sets default transaction.
Definition KDbConnection.cpp:2079
QStringList tableNames(bool alsoSystemTables=false, bool *ok=nullptr)
Definition KDbConnection.cpp:1007
bool executeSql(const KDbEscapedString &sql)
Executes a new native (raw, backend-specific) SQL query.
Definition KDbConnection.cpp:1286
virtual KDbSqlResult * drv_prepareSql(const KDbEscapedString &sql)=0
Prepares query for a raw SQL statement sql with possibility of returning records.
tristate querySingleStringInternal(const KDbEscapedString *sql, QString *value, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
Definition KDbConnection.cpp:2408
virtual bool drv_disconnect()=0
virtual QString escapeIdentifier(const QString &id) const
Identifier escaping function in the associated KDbDriver.
Definition KDbConnection.cpp:3044
virtual bool drv_createDatabase(const QString &dbName=QString())=0
bool storeDataBlock(int objectID, const QString &dataString, const QString &dataID=QString())
Definition KDbConnection.cpp:2946
tristate dropTable(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:1590
virtual QString anyAvailableDatabaseName()
Definition KDbConnection.cpp:3065
virtual KDbTransactionData * drv_beginTransaction()
Definition KDbConnection.cpp:2110
KDbServerVersionInfo serverVersion() const
Definition KDbConnection.cpp:1049
virtual bool drv_createTable(const KDbTableSchema &tableSchema)
Creates table using tableSchema information.
Definition KDbConnection.cpp:1874
tristate alterTable(KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)
Definition KDbConnection.cpp:1671
virtual bool drv_databaseExists(const QString &dbName, bool ignoreErrors=true)
Definition KDbConnection.cpp:613
virtual bool drv_copyTableData(const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema)
Definition KDbConnection.cpp:1559
KDbField * findSystemFieldName(const KDbFieldList &fieldlist)
Definition KDbConnection.cpp:1303
bool dropDatabase(const QString &dbName=QString())
Drops database with name dbName.
Definition KDbConnection.cpp:920
QStringList databaseNames(bool also_system_db=false)
Definition KDbConnection.cpp:573
virtual KDbCursor * prepareQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)=0
bool checkIfColumnExists(KDbCursor *cursor, int column)
Definition KDbConnection.cpp:2398
bool rollbackTransaction(KDbTransaction trans=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
Rolls back specified transaction for this connection.
Definition KDbConnection.cpp:2029
virtual bool drv_dropDatabase(const QString &dbName=QString())=0
bool createTable(KDbTableSchema *tableSchema, CreateTableOptions options=CreateTableOption::Default)
Creates a new table.
Definition KDbConnection.cpp:1397
virtual bool drv_rollbackTransaction(KDbTransactionData *trans)
Definition KDbConnection.cpp:2122
KDbTransaction beginTransaction()
Starts a new database transaction.
Definition KDbConnection.cpp:1953
bool loadExtendedTableSchemaData(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:2751
bool deleteAllRecords(KDbQuerySchema *query)
Definition KDbConnection.cpp:3430
QStringList objectNames(int objectType=KDb::AnyObjectType, bool *ok=nullptr)
Definition KDbConnection.cpp:981
QSharedPointer< KDbSqlResult > prepareSql(const KDbEscapedString &sql)
Prepares execution of a new native (raw, backend-specific) SQL query.
Definition KDbConnection.cpp:1280
virtual bool drv_dropTable(const QString &tableName)
Definition KDbConnection.cpp:1585
QList< int > objectIds(int objectType, bool *ok=nullptr)
Definition KDbConnection.cpp:1074
tristate querySingleRecordInternal(KDbRecordData *data, const KDbEscapedString *sql, KDbQuerySchema *query, const QList< QVariant > *params, QueryRecordOptions options)
Definition KDbConnection.cpp:2353
bool storeObjectData(KDbObject *object)
Definition KDbConnection.cpp:2319
tristate querySingleRecord(const KDbEscapedString &sql, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2380
KDbTableSchema * tableSchema(int tableId)
Definition KDbConnection.cpp:2919
bool storeExtendedTableSchemaData(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:2680
KDbCursor * executeQueryInternal(const KDbEscapedString &sql, KDbQuerySchema *query, const QList< QVariant > *params)
Definition KDbConnection.cpp:2335
bool dropQuery(KDbQuerySchema *querySchema)
Definition KDbConnection.cpp:1813
virtual bool drv_connect()=0
bool copyDataBlock(int sourceObjectID, int destObjectID, const QString &dataID=QString())
Definition KDbConnection.cpp:2972
tristate querySingleNumber(const KDbEscapedString &sql, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2477
bool createDatabase(const QString &dbName)
Creates new database with name dbName, using this connection.
Definition KDbConnection.cpp:695
QString currentDatabase() const
Get the name of the current database.
Definition KDbConnection.cpp:892
bool useDatabase(const QString &dbName=QString(), bool kexiCompatible=true, bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)
Opens an existing database specified by dbName.
Definition KDbConnection.cpp:787
virtual bool drv_beforeInsert(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1219
virtual bool drv_afterInsert(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1231
bool setupObjectData(const KDbRecordData &data, KDbObject *object)
Definition KDbConnection.cpp:2199
virtual KDbEscapedString recentSqlString() const
Return recently used SQL string.
Definition KDbConnection.cpp:3531
bool beginAutoCommitTransaction(KDbTransactionGuard *tg)
Definition KDbConnection.cpp:1893
KDbVersionInfo databaseVersion() const
Definition KDbConnection.cpp:1054
bool alterTableName(KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)
Alters name of table.
Definition KDbConnection.cpp:1700
bool rollbackAutoCommitTransaction(const KDbTransaction &trans)
Definition KDbConnection.cpp:1937
tristate resultExists(const KDbEscapedString &sql, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2556
virtual bool drv_afterUpdate(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1255
bool deleteRecord(KDbQuerySchema *query, KDbRecordData *data, bool useRecordId=false)
Definition KDbConnection.cpp:3363
QList< KDbTransaction > transactions()
Returns set of handles of currently active transactions.
Definition KDbConnection.cpp:2090
tristate dropTableInternal(KDbTableSchema *tableSchema, bool alsoRemoveSchema)
Definition KDbConnection.cpp:1595
bool useTemporaryDatabaseIfNeeded(QString *name)
Definition KDbConnection.cpp:897
virtual bool drv_beforeUpdate(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1243
KDbQuerySchema * querySchema(int queryId)
Definition KDbConnection.cpp:3021
bool storeNewObjectData(KDbObject *object)
Definition KDbConnection.cpp:2324
bool commitTransaction(KDbTransaction transaction=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
Commits specified transaction for this connection.
Definition KDbConnection.cpp:1992
virtual bool drv_commitTransaction(KDbTransactionData *trans)
Definition KDbConnection.cpp:2117
KDbTransaction defaultTransaction() const
Returns handle of default transaction for this connection.
Definition KDbConnection.cpp:2074
virtual tristate drv_containsTable(const QString &tableName)=0
virtual bool drv_getDatabasesList(QStringList *list)
Definition KDbConnection.cpp:607
tristate querySingleNumberInternal(const KDbEscapedString *sql, int *number, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
Definition KDbConnection.cpp:2458
tristate containsTable(const QString &tableName)
Definition KDbConnection.cpp:1039
bool queryStringListInternal(const KDbEscapedString *sql, QStringList *list, KDbQuerySchema *query, const QList< QVariant > *params, int column, bool(*filterFunction)(const QString &))
Definition KDbConnection.cpp:2496
Definition KDbFieldList.h:34
Definition KDbMessageHandler.h:135
Definition KDbObject.shared.h:32
Prepared statement interface for backend-dependent implementations.
Definition KDbPreparedStatementInterface.h:32
Prepared database command for optimizing sequences of multiple database actions.
Definition KDbPreparedStatement.h:76
KDbQuerySchema provides information about database query.
Definition KDbQuerySchema.h:46
Structure for storing single record with type information.
Definition KDbRecordData.h:37
provides data for single edited database record
Definition KDbRecordEditBuffer.h:77
Definition KDbResult.shared.h:35
The KDbSqlResult class abstracts result of a raw SQL query preparation by KDbConnection::prepareSql()
Definition KDbSqlResult.h:45
Definition KDbTableSchema.h:38
Internal prototype for storing transaction handle for KDbTransaction object.
Definition KDbTransactionData.h:36
KDbTransactionGuard class is a convenience class that simplifies handling transactions.
Definition KDbTransactionGuard.h:52
Definition KDbVersionInfo.shared.h:44
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition KDbTristate.h:101
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.