KDb
KDbConnectionProxy.cpp
45 : KDbConnection(parentConnection->driver(), parentConnection->data(), *parentConnection->options())
137bool KDbConnectionProxy::useDatabase(const QString &dbName, bool kexiCompatible, bool *cancelled,
250KDbCursor* KDbConnectionProxy::prepareQuery(const KDbEscapedString& sql, KDbCursor::Options options)
265KDbCursor* KDbConnectionProxy::executeQuery(const KDbEscapedString& sql, KDbCursor::Options options)
270KDbCursor* KDbConnectionProxy::executeQuery(KDbQuerySchema* query, const QList<QVariant>& params,
334tristate KDbConnectionProxy::querySingleString(const KDbEscapedString& sql, QString* value, int column,
340tristate KDbConnectionProxy::querySingleString(KDbQuerySchema* query, QString* value, int column,
353tristate KDbConnectionProxy::querySingleNumber(const KDbEscapedString& sql, int* number, int column,
372bool KDbConnectionProxy::queryStringList(const KDbEscapedString& sql, QStringList* list, int column)
388tristate KDbConnectionProxy::resultExists(const KDbEscapedString& sql, QueryRecordOptions options)
405#define H_INS_REC(args, ...) bool KDbConnectionProxy::insertRecord(KDbTableSchema* tableSchema args) \
431bool KDbConnectionProxy::insertRecord(KDbTableSchema* tableSchema, const QList<QVariant>& values)
446KDbTableSchema *KDbConnectionProxy::copyTable(const KDbTableSchema &tableSchema, const KDbObject &newData)
451KDbTableSchema *KDbConnectionProxy::copyTable(const QString& tableName, const KDbObject &newData)
466tristate KDbConnectionProxy::alterTable(KDbTableSchema* tableSchema, KDbTableSchema* newTableSchema)
542tristate KDbConnectionProxy::loadDataBlock(int objectID, QString* dataString, const QString& dataID)
553bool KDbConnectionProxy::copyDataBlock(int sourceObjectID, int destObjectID, const QString& dataID)
626tristate KDbConnectionProxy::dropTableInternal(KDbTableSchema* tableSchema, bool alsoRemoveSchema)
762bool KDbConnectionProxy::updateRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool useRecordId)
767bool KDbConnectionProxy::insertRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool getRecordId)
772bool KDbConnectionProxy::deleteRecord(KDbQuerySchema* query, KDbRecordData* data, bool useRecordId)
787tristate KDbConnectionProxy::querySingleRecordInternal(KDbRecordData* data, const KDbEscapedString* sql,
794tristate KDbConnectionProxy::querySingleStringInternal(const KDbEscapedString* sql, QString* value,
812 return d->connection->queryStringListInternal(sql, list, query, params, column, filterFunction);
815KDbCursor* KDbConnectionProxy::executeQueryInternal(const KDbEscapedString& sql, KDbQuerySchema* query,
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
QStringList drv_getTableNames(bool *ok) override
Definition KDbConnectionProxy.cpp:594
bool drv_beforeUpdate(const QString &tableName, KDbFieldList *fields) override
Definition KDbConnectionProxy.cpp:717
bool drv_dropDatabase(const QString &dbName=QString()) override
Definition KDbConnectionProxy.cpp:682
bool drv_executeSql(const KDbEscapedString &sql) override
Executes query for a raw SQL statement sql without returning resulting records.
Definition KDbConnectionProxy.cpp:646
bool drv_beforeInsert(const QString &tableName, KDbFieldList *fields) override
Definition KDbConnectionProxy.cpp:707
tristate drv_containsTable(const QString &tableName) override
Definition KDbConnectionProxy.cpp:600
bool drv_closeDatabase() override
Definition KDbConnectionProxy.cpp:672
KDbEscapedString recentSqlString() const override
Return recently used SQL string.
Definition KDbConnectionProxy.cpp:398
bool drv_getDatabasesList(QStringList *list) override
Definition KDbConnectionProxy.cpp:651
~KDbConnectionProxy() override
Deletes this proxy. Owned connection is closed and destroyed.
Definition KDbConnectionProxy.cpp:52
bool drv_afterUpdate(const QString &tableName, KDbFieldList *fields) override
Definition KDbConnectionProxy.cpp:722
KDbCursor * prepareQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None) override
Definition KDbConnectionProxy.cpp:250
QString anyAvailableDatabaseName() override
Definition KDbConnectionProxy.cpp:497
bool drv_copyTableData(const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema) override
Definition KDbConnectionProxy.cpp:615
QString escapeIdentifier(const QString &id) const override
Identifier escaping function in the associated KDbDriver.
Definition KDbConnectionProxy.cpp:574
bool drv_setAutoCommit(bool on) override
Definition KDbConnectionProxy.cpp:727
bool drv_dropTable(const QString &tableName) override
Definition KDbConnectionProxy.cpp:621
bool drv_alterTableName(KDbTableSchema *tableSchema, const QString &newName) override
Definition KDbConnectionProxy.cpp:610
void setParentConnectionIsOwned(bool set)
Control owhership of parent connection that is assigned to this proxy.
Definition KDbConnectionProxy.cpp:67
KDbConnection * parentConnection()
Definition KDbConnectionProxy.cpp:57
bool drv_disconnect() override
Definition KDbConnectionProxy.cpp:584
bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr) override
Definition KDbConnectionProxy.cpp:666
bool drv_getServerVersion(KDbServerVersionInfo *version) override
Definition KDbConnectionProxy.cpp:589
KDbSqlResult * drv_prepareSql(const KDbEscapedString &sql) override
Prepares query for a raw SQL statement sql with possibility of returning records.
Definition KDbConnectionProxy.cpp:641
KDbTransactionData * drv_beginTransaction() override
Definition KDbConnectionProxy.cpp:692
bool drv_rollbackTransaction(KDbTransactionData *trans) override
Definition KDbConnectionProxy.cpp:702
bool drv_isDatabaseUsed() const override
Definition KDbConnectionProxy.cpp:677
bool drv_createDatabase(const QString &dbName=QString()) override
Definition KDbConnectionProxy.cpp:661
bool drv_afterInsert(const QString &tableName, KDbFieldList *fields) override
Definition KDbConnectionProxy.cpp:712
bool drv_commitTransaction(KDbTransactionData *trans) override
Definition KDbConnectionProxy.cpp:697
bool drv_createTable(const KDbTableSchema &tableSchema) override
Creates table using tableSchema information.
Definition KDbConnectionProxy.cpp:605
bool drv_databaseExists(const QString &dbName, bool ignoreErrors=true) override
Definition KDbConnectionProxy.cpp:656
tristate loadObjectData(int type, int id, KDbObject *object)
Definition KDbConnectionProxy.cpp:532
KDbPreparedStatementInterface * prepareStatementInternal() override
Definition KDbConnectionProxy.cpp:732
KDbConnectionProxy(KDbConnection *connection)
Creates a proxy object for parent connection.
Definition KDbConnectionProxy.cpp:44
KDbEscapedString escapeString(const QString &str) const override
Definition KDbConnectionProxy.cpp:245
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 Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.