KDbConnectionProxy

Search for usage in LXR

KDbConnectionProxy Class Reference

#include <KDbConnectionProxy.h>

Inheritance diagram for KDbConnectionProxy:

Public Member Functions

 KDbConnectionProxy (KDbConnection *connection)
 
 ~KDbConnectionProxy () override
 
tristate alterTable (KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)
 
bool alterTableName (KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)
 
QString anyAvailableDatabaseName () override
 
bool autoCommit () const
 
bool beginAutoCommitTransaction (KDbTransactionGuard *tg)
 
KDbTransaction beginTransaction ()
 
bool checkConnected ()
 
bool checkIfColumnExists (KDbCursor *cursor, int column)
 
bool checkIsDatabaseUsed ()
 
void clearResult ()
 
bool closeDatabase ()
 
bool commitAutoCommitTransaction (const KDbTransaction &trans)
 
bool commitTransaction (KDbTransaction trans=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
 
bool connect ()
 
tristate containsTable (const QString &tableName)
 
bool copyDataBlock (int sourceObjectID, int destObjectID, const QString &dataID=QString())
 
KDbTableSchemacopyTable (const KDbTableSchema &tableSchema, const KDbObject &newData)
 
KDbTableSchemacopyTable (const QString &tableName, const KDbObject &newData)
 
bool createDatabase (const QString &dbName)
 
bool createTable (KDbTableSchema *tableSchema, CreateTableOptions options=CreateTableOption::Default)
 
QString currentDatabase () const
 
KDbConnectionData data () const
 
bool databaseExists (const QString &dbName, bool ignoreErrors=true)
 
QStringList databaseNames (bool also_system_db=false)
 
KDbProperties databaseProperties () const
 
KDbVersionInfo databaseVersion () const
 
KDbTransaction defaultTransaction () const
 
bool deleteAllRecords (KDbQuerySchema *query)
 
bool deleteCursor (KDbCursor *cursor)
 
bool deleteRecord (KDbQuerySchema *query, KDbRecordData *data, bool useRecordId=false)
 
bool disconnect ()
 
KDbDriverdriver () const
 
bool dropDatabase (const QString &dbName=QString())
 
bool dropQuery (const QString &queryName)
 
bool dropQuery (KDbQuerySchema *querySchema)
 
tristate dropTable (const QString &tableName)
 
tristate dropTable (KDbTableSchema *tableSchema)
 
tristate dropTableInternal (KDbTableSchema *tableSchema, bool alsoRemoveSchema)
 
bool drv_afterInsert (const QString &tableName, KDbFieldList *fields) override
 
bool drv_afterUpdate (const QString &tableName, KDbFieldList *fields) override
 
bool drv_alterTableName (KDbTableSchema *tableSchema, const QString &newName) override
 
bool drv_beforeInsert (const QString &tableName, KDbFieldList *fields) override
 
bool drv_beforeUpdate (const QString &tableName, KDbFieldList *fields) override
 
KDbTransactionDatadrv_beginTransaction () override
 
bool drv_closeDatabase () override
 
bool drv_commitTransaction (KDbTransactionData *trans) override
 
bool drv_connect () override
 
tristate drv_containsTable (const QString &tableName) override
 
bool drv_copyTableData (const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema) override
 
bool drv_createDatabase (const QString &dbName=QString()) override
 
bool drv_createTable (const KDbTableSchema &tableSchema) override
 
bool drv_createTable (const QString &tableName) override
 
bool drv_databaseExists (const QString &dbName, bool ignoreErrors=true) override
 
bool drv_disconnect () override
 
bool drv_dropDatabase (const QString &dbName=QString()) override
 
bool drv_dropTable (const QString &tableName) override
 
bool drv_executeSql (const KDbEscapedString &sql) override
 
bool drv_getDatabasesList (QStringList *list) override
 
bool drv_getServerVersion (KDbServerVersionInfo *version) override
 
QStringList drv_getTableNames (bool *ok) override
 
bool drv_isDatabaseUsed () const override
 
KDbSqlResultdrv_prepareSql (const KDbEscapedString &sql) override
 
bool drv_rollbackTransaction (KDbTransactionData *trans) override
 
bool drv_setAutoCommit (bool on) override
 
bool drv_useDatabase (const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr) override
 
QString escapeIdentifier (const QString &id) const override
 
KDbEscapedString escapeString (const QString &str) const override
 
KDbCursorexecuteQuery (const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbQuerySchema *query, const QList< QVariant > &params, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbQuerySchema *query, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbTableSchema *table, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQueryInternal (const KDbEscapedString &sql, KDbQuerySchema *query, const QList< QVariant > *params)
 
bool executeSql (const KDbEscapedString &sql)
 
KDbFieldfindSystemFieldName (const KDbFieldList &fieldlist)
 
bool insertRecord (KDbFieldList *fields, const QList< QVariant > &values)
 
bool insertRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool getRecordId=false)
 
bool insertRecord (KDbTableSchema *tableSchema, const QList< QVariant > &values)
 
bool isConnected () const
 
bool isDatabaseUsed () const
 
tristate isEmpty (KDbTableSchema *table)
 
bool isInternalTableSchema (const QString &tableName)
 
tristate loadDataBlock (int objectID, QString *dataString, const QString &dataID=QString())
 
bool loadExtendedTableSchemaData (KDbTableSchema *tableSchema)
 
tristate loadObjectData (int type, const QString &name, KDbObject *object)
 
tristate loadObjectData (int type, int id, KDbObject *object)
 
QList< int > objectIds (int objectType, bool *ok=nullptr)
 
QStringList objectNames (int objectType=KDb::AnyObjectType, bool *ok=nullptr)
 
KDbConnectionOptionsoptions ()
 
KDbConnectionparentConnection ()
 
const KDbConnectionparentConnection () const
 
KDbCursorprepareQuery (const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None) override
 
KDbCursorprepareQuery (KDbQuerySchema *query, KDbCursor::Options options=KDbCursor::Option::None) override
 
KDbCursorprepareQuery (KDbTableSchema *table, KDbCursor::Options options=KDbCursor::Option::None)
 
QSharedPointer< KDbSqlResultprepareSql (const KDbEscapedString &sql)
 
KDbPreparedStatement prepareStatement (KDbPreparedStatement::Type type, KDbFieldList *fields, const QStringList &whereFieldNames=QStringList())
 
KDbPreparedStatementInterfaceprepareStatementInternal () override
 
QList< int > queryIds (bool *ok=nullptr)
 
KDbQuerySchemaquerySchema (const QString &queryName)
 
KDbQuerySchemaquerySchema (int queryId)
 
tristate querySingleNumber (const KDbEscapedString &sql, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleNumber (KDbQuerySchema *query, int *number, const QList< QVariant > &params, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleNumber (KDbQuerySchema *query, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleNumberInternal (const KDbEscapedString *sql, int *number, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
 
tristate querySingleRecord (const KDbEscapedString &sql, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecord (KDbQuerySchema *query, KDbRecordData *data, const QList< QVariant > &params, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecord (KDbQuerySchema *query, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecordInternal (KDbRecordData *data, const KDbEscapedString *sql, KDbQuerySchema *query, const QList< QVariant > *params, QueryRecordOptions options)
 
tristate querySingleString (const KDbEscapedString &sql, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleString (KDbQuerySchema *query, QString *value, const QList< QVariant > &params, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleString (KDbQuerySchema *query, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleStringInternal (const KDbEscapedString *sql, QString *value, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
 
bool queryStringList (const KDbEscapedString &sql, QStringList *list, int column=0)
 
bool queryStringList (KDbQuerySchema *query, QStringList *list, const QList< QVariant > &params, int column=0)
 
bool queryStringList (KDbQuerySchema *query, QStringList *list, int column=0)
 
bool queryStringListInternal (const KDbEscapedString *sql, QStringList *list, KDbQuerySchema *query, const QList< QVariant > *params, int column, bool(*filterFunction)(const QString &))
 
KDbEscapedString recentSqlString () const override
 
bool removeDataBlock (int objectID, const QString &dataID=QString())
 
bool removeObject (int objId)
 
KDbResult result () const
 
KDbResultable resultable () const
 
tristate resultExists (const KDbEscapedString &sql, QueryRecordOptions options=QueryRecordOption::Default)
 
bool rollbackAutoCommitTransaction (const KDbTransaction &trans)
 
bool rollbackTransaction (KDbTransaction trans=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
 
KDbServerVersionInfo serverVersion () const
 
bool setAutoCommit (bool on)
 
void setAvailableDatabaseName (const QString &dbName)
 
void setDefaultTransaction (const KDbTransaction &trans)
 
void setParentConnectionIsOwned (bool set)
 
bool setQuerySchemaObsolete (const QString &queryName)
 
KDbFieldsetupField (const KDbRecordData &data)
 
bool setupObjectData (const KDbRecordData &data, KDbObject *object)
 
bool storeDataBlock (int objectID, const QString &dataString, const QString &dataID=QString())
 
bool storeExtendedTableSchemaData (KDbTableSchema *tableSchema)
 
bool storeMainFieldSchema (KDbField *field)
 
bool storeNewObjectData (KDbObject *object)
 
bool storeObjectData (KDbObject *object)
 
QList< int > tableIds (bool *ok=nullptr)
 
QStringList tableNames (bool alsoSystemTables=false, bool *ok=nullptr)
 
KDbTableSchematableSchema (const QString &tableName)
 
KDbTableSchematableSchema (int tableId)
 
QList< KDbTransactiontransactions ()
 
bool updateRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
 
bool useDatabase (const QString &dbName=QString(), bool kexiCompatible=true, bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)
 
bool useTemporaryDatabaseIfNeeded (QString *name)
 

Public Attributes

 H_INS_REC_ALL
 

Additional Inherited Members

- Protected Types inherited from KDbConnection
enum class  AlterTableNameOption { Default = 0 , DropDestination = 1 }
 
typedef QFlags< AlterTableNameOptionAlterTableNameOptions
 
enum class  CreateTableOption { Default = 0 , DropDestination = 1 }
 
typedef QFlags< CreateTableOptionCreateTableOptions
 
enum class  QueryRecordOption { AddLimitTo1 = 1 , Default = AddLimitTo1 }
 
typedef QFlags< QueryRecordOptionQueryRecordOptions
 
- Protected Member Functions inherited from KDbConnection
 KDbConnection (KDbDriver *driver, const KDbConnectionData &connData, const KDbConnectionOptions &options)
 
void addCursor (KDbCursor *cursor)
 
bool beginAutoCommitTransaction (KDbTransactionGuard *tg)
 
bool checkConnected ()
 
bool checkIfColumnExists (KDbCursor *cursor, int column)
 
bool checkIsDatabaseUsed ()
 
bool commitAutoCommitTransaction (const KDbTransaction &trans)
 
bool deleteAllRecords (KDbQuerySchema *query)
 
bool deleteRecord (KDbQuerySchema *query, KDbRecordData *data, bool useRecordId=false)
 
void destroy ()
 
tristate dropTableInternal (KDbTableSchema *tableSchema, bool alsoRemoveSchema)
 
virtual tristate drv_changeFieldProperty (KDbTableSchema *table, KDbField *field, const QString &propertyName, const QVariant &value)
 
KDbCursorexecuteQueryInternal (const KDbEscapedString &sql, KDbQuerySchema *query, const QList< QVariant > *params)
 
bool insertRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool getRecordId=false)
 
QSharedPointer< KDbSqlResultinsertRecordInternal (const QString &tableSchemaName, KDbFieldList *fields, const KDbEscapedString &sql)
 
bool loadExtendedTableSchemaData (KDbTableSchema *tableSchema)
 
tristate querySingleNumberInternal (const KDbEscapedString *sql, int *number, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
 
tristate querySingleRecordInternal (KDbRecordData *data, const KDbEscapedString *sql, KDbQuerySchema *query, const QList< QVariant > *params, QueryRecordOptions options)
 
tristate querySingleStringInternal (const KDbEscapedString *sql, QString *value, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
 
bool queryStringListInternal (const KDbEscapedString *sql, QStringList *list, KDbQuerySchema *query, const QList< QVariant > *params, int column, bool(*filterFunction)(const QString &))
 
void removeMe (KDbTableSchema *ts)
 
bool rollbackAutoCommitTransaction (const KDbTransaction &trans)
 
KDbFieldsetupField (const KDbRecordData &data)
 
bool setupObjectData (const KDbRecordData &data, KDbObject *object)
 
bool storeExtendedTableSchemaData (KDbTableSchema *tableSchema)
 
bool storeMainFieldSchema (KDbField *field)
 
void takeCursor (KDbCursor *cursor)
 
bool updateRecord (KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
 
 ~KDbConnection () override
 
tristate alterTable (KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)
 
bool alterTableName (KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)
 
bool autoCommit () const
 
KDbTransaction beginTransaction ()
 
void clearResult ()
 
bool closeDatabase ()
 
bool commitTransaction (KDbTransaction transaction=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
 
bool connect ()
 
tristate containsTable (const QString &tableName)
 
bool copyDataBlock (int sourceObjectID, int destObjectID, const QString &dataID=QString())
 
KDbTableSchemacopyTable (const KDbTableSchema &tableSchema, const KDbObject &newData)
 
KDbTableSchemacopyTable (const QString &tableName, const KDbObject &newData)
 
bool createDatabase (const QString &dbName)
 
bool createTable (KDbTableSchema *tableSchema, CreateTableOptions options=CreateTableOption::Default)
 
QString currentDatabase () const
 
KDbConnectionData data () const
 
bool databaseExists (const QString &dbName, bool ignoreErrors=true)
 
QStringList databaseNames (bool also_system_db=false)
 
KDbProperties databaseProperties () const
 
KDbVersionInfo databaseVersion () const
 
KDbTransaction defaultTransaction () const
 
bool deleteCursor (KDbCursor *cursor)
 
bool disconnect ()
 
KDbDriverdriver () const
 
bool dropDatabase (const QString &dbName=QString())
 
bool dropQuery (const QString &queryName)
 
bool dropQuery (KDbQuerySchema *querySchema)
 
tristate dropTable (const QString &tableName)
 
tristate dropTable (KDbTableSchema *tableSchema)
 
KDbCursorexecuteQuery (const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbQuerySchema *query, const QList< QVariant > &params, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbQuerySchema *query, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorexecuteQuery (KDbTableSchema *table, KDbCursor::Options options=KDbCursor::Option::None)
 
bool executeSql (const KDbEscapedString &sql)
 
KDbFieldfindSystemFieldName (const KDbFieldList &fieldlist)
 
QSharedPointer< KDbSqlResultinsertRecord (KDbFieldList *fields, const QList< QVariant > &values)
 
QSharedPointer< KDbSqlResultinsertRecord (KDbTableSchema *tableSchema, const QList< QVariant > &values)
 
bool isConnected () const
 
bool isDatabaseUsed () const
 
tristate isEmpty (KDbTableSchema *table)
 
bool isInternalTableSchema (const QString &tableName)
 
tristate loadDataBlock (int objectID, QString *dataString, const QString &dataID=QString())
 
tristate loadObjectData (int type, const QString &name, KDbObject *object)
 
tristate loadObjectData (int type, int id, KDbObject *object)
 
QList< int > objectIds (int objectType, bool *ok=nullptr)
 
QStringList objectNames (int objectType=KDb::AnyObjectType, bool *ok=nullptr)
 
KDbConnectionOptionsoptions ()
 
KDbCursorprepareQuery (KDbQuerySchema *query, const QList< QVariant > &params, KDbCursor::Options options=KDbCursor::Option::None)
 
KDbCursorprepareQuery (KDbTableSchema *table, KDbCursor::Options options=KDbCursor::Option::None)
 
QSharedPointer< KDbSqlResultprepareSql (const KDbEscapedString &sql)
 
KDbPreparedStatement prepareStatement (KDbPreparedStatement::Type type, KDbFieldList *fields, const QStringList &whereFieldNames=QStringList())
 
QList< int > queryIds (bool *ok=nullptr)
 
KDbQuerySchemaquerySchema (const QString &queryName)
 
KDbQuerySchemaquerySchema (int queryId)
 
tristate querySingleNumber (const KDbEscapedString &sql, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleNumber (KDbQuerySchema *query, int *number, const QList< QVariant > &params, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleNumber (KDbQuerySchema *query, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecord (const KDbEscapedString &sql, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecord (KDbQuerySchema *query, KDbRecordData *data, const QList< QVariant > &params, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleRecord (KDbQuerySchema *query, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleString (const KDbEscapedString &sql, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleString (KDbQuerySchema *query, QString *value, const QList< QVariant > &params, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
tristate querySingleString (KDbQuerySchema *query, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
 
bool queryStringList (const KDbEscapedString &sql, QStringList *list, int column=0)
 
bool queryStringList (KDbQuerySchema *query, QStringList *list, const QList< QVariant > &params, int column=0)
 
bool queryStringList (KDbQuerySchema *query, QStringList *list, int column=0)
 
int recordCount (const KDbEscapedString &sql)
 
int recordCount (const KDbTableSchema &tableSchema)
 
int recordCount (KDbQuerySchema *querySchema, const QList< QVariant > &params=QList< QVariant >())
 
int recordCount (KDbTableOrQuerySchema *tableOrQuery, const QList< QVariant > &params=QList< QVariant >())
 
bool removeDataBlock (int objectID, const QString &dataID=QString())
 
bool removeObject (int objId)
 
tristate resultExists (const KDbEscapedString &sql, QueryRecordOptions options=QueryRecordOption::Default)
 
bool rollbackTransaction (KDbTransaction trans=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
 
KDbServerVersionInfo serverVersion () const
 
bool setAutoCommit (bool on)
 
void setAvailableDatabaseName (const QString &dbName)
 
void setDefaultTransaction (const KDbTransaction &trans)
 
bool setQuerySchemaObsolete (const QString &queryName)
 
bool storeDataBlock (int objectID, const QString &dataString, const QString &dataID=QString())
 
bool storeNewObjectData (KDbObject *object)
 
bool storeObjectData (KDbObject *object)
 
QList< int > tableIds (bool *ok=nullptr)
 
QStringList tableNames (bool alsoSystemTables=false, bool *ok=nullptr)
 
KDbTableSchematableSchema (const QString &tableName)
 
KDbTableSchematableSchema (int tableId)
 
QList< KDbTransactiontransactions ()
 
bool useDatabase (const QString &dbName=QString(), bool kexiCompatible=true, bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)
 
bool useTemporaryDatabaseIfNeeded (QString *name)
 
- Protected Member Functions inherited from KDbResultable
 KDbResultable (const KDbResultable &other)
 
void clearResult ()
 
KDbMessageHandlermessageHandler () const
 
KDbResultableoperator= (const KDbResultable &other)
 
KDbResult result () const
 
virtual QString serverResultName () const
 
void setMessageHandler (KDbMessageHandler *handler)
 
void showMessage ()
 
- Static Protected Member Functions inherited from KDbConnection
static QStringList kdbSystemTableNames ()
 
- Protected Attributes inherited from KDbConnection
 H_INS_REC_ALL
 
- Protected Attributes inherited from KDbResultable
Private *const d
 
KDbResult m_result
 

Detailed Description

The KDbConnectionProxy class gives access to protected (low-level) API of KDbConnection.

The connection object specified in constructor of the proxy is called a parent connection. All inherited methods of the KDbConnection API call equivalent methods of the parent connection. The KDbConnectionProxy class also provides non-virtual methods that are equivalent to KDbConnection ones. These KDbConnection's equivalent methods are called by the proxy too.

Example use of this class is Kexi's database database migration plugins when the source database is only accessibly using low-level routines.

Definition at line 36 of file KDbConnectionProxy.h.

Constructor & Destructor Documentation

◆ KDbConnectionProxy()

KDbConnectionProxy::KDbConnectionProxy ( KDbConnection * connection)
explicit

Creates a proxy object for parent connection.

connection must not be nullptr. It is owned by this proxy unless setConnectionIsOwned(false) is called.

Definition at line 44 of file KDbConnectionProxy.cpp.

◆ ~KDbConnectionProxy()

KDbConnectionProxy::~KDbConnectionProxy ( )
override

Deletes this proxy. Owned connection is closed and destroyed.

Definition at line 52 of file KDbConnectionProxy.cpp.

Member Function Documentation

◆ alterTable()

tristate KDbConnectionProxy::alterTable ( KDbTableSchema * tableSchema,
KDbTableSchema * newTableSchema )

Definition at line 466 of file KDbConnectionProxy.cpp.

◆ alterTableName()

bool KDbConnectionProxy::alterTableName ( KDbTableSchema * tableSchema,
const QString & newName,
AlterTableNameOptions options = AlterTableNameOption::Default )

Definition at line 471 of file KDbConnectionProxy.cpp.

◆ anyAvailableDatabaseName()

QString KDbConnectionProxy::anyAvailableDatabaseName ( )
overridevirtual
Returns
name of any (e.g. first found) database for this connection. This method does not close or open this connection. The method can be used (it is also internally used, e.g. for database dropping) when we need a database name before we can connect and execute any SQL statement (e.g. DROP DATABASE).

The method can return nul lstring, but in this situation no automatic (implicit) connections could be made, what is useful by e.g. dropDatabase().

Note for driver developers: return here a name of database which you are sure is existing. Default implementation returns:

See description of KDbDriverBehavior::ALWAYS_AVAILABLE_DATABASE_NAME member. You may want to reimplement this method only when you need to depend on this connection specifics (e.g. you need to check something remotely).

Reimplemented from KDbConnection.

Definition at line 497 of file KDbConnectionProxy.cpp.

◆ autoCommit()

bool KDbConnectionProxy::autoCommit ( ) const

Definition at line 235 of file KDbConnectionProxy.cpp.

◆ beginAutoCommitTransaction()

bool KDbConnectionProxy::beginAutoCommitTransaction ( KDbTransactionGuard * tg)

Definition at line 737 of file KDbConnectionProxy.cpp.

◆ beginTransaction()

KDbTransaction KDbConnectionProxy::beginTransaction ( )

Definition at line 203 of file KDbConnectionProxy.cpp.

◆ checkConnected()

bool KDbConnectionProxy::checkConnected ( )

Definition at line 752 of file KDbConnectionProxy.cpp.

◆ checkIfColumnExists()

bool KDbConnectionProxy::checkIfColumnExists ( KDbCursor * cursor,
int column )

Definition at line 782 of file KDbConnectionProxy.cpp.

◆ checkIsDatabaseUsed()

bool KDbConnectionProxy::checkIsDatabaseUsed ( )

Definition at line 757 of file KDbConnectionProxy.cpp.

◆ clearResult()

void KDbConnectionProxy::clearResult ( )

Definition at line 102 of file KDbConnectionProxy.cpp.

◆ closeDatabase()

bool KDbConnectionProxy::closeDatabase ( )

Definition at line 143 of file KDbConnectionProxy.cpp.

◆ commitAutoCommitTransaction()

bool KDbConnectionProxy::commitAutoCommitTransaction ( const KDbTransaction & trans)

Definition at line 742 of file KDbConnectionProxy.cpp.

◆ commitTransaction()

bool KDbConnectionProxy::commitTransaction ( KDbTransaction trans = KDbTransaction(),
KDbTransaction::CommitOptions options = KDbTransaction::CommitOptions() )

Definition at line 208 of file KDbConnectionProxy.cpp.

◆ connect()

bool KDbConnectionProxy::connect ( )

Definition at line 82 of file KDbConnectionProxy.cpp.

◆ containsTable()

tristate KDbConnectionProxy::containsTable ( const QString & tableName)

Definition at line 168 of file KDbConnectionProxy.cpp.

◆ copyDataBlock()

bool KDbConnectionProxy::copyDataBlock ( int sourceObjectID,
int destObjectID,
const QString & dataID = QString() )

Definition at line 553 of file KDbConnectionProxy.cpp.

◆ copyTable() [1/2]

KDbTableSchema * KDbConnectionProxy::copyTable ( const KDbTableSchema & tableSchema,
const KDbObject & newData )

Definition at line 446 of file KDbConnectionProxy.cpp.

◆ copyTable() [2/2]

KDbTableSchema * KDbConnectionProxy::copyTable ( const QString & tableName,
const KDbObject & newData )

Definition at line 451 of file KDbConnectionProxy.cpp.

◆ createDatabase()

bool KDbConnectionProxy::createDatabase ( const QString & dbName)

Definition at line 132 of file KDbConnectionProxy.cpp.

◆ createTable()

bool KDbConnectionProxy::createTable ( KDbTableSchema * tableSchema,
CreateTableOptions options = CreateTableOption::Default )

Definition at line 441 of file KDbConnectionProxy.cpp.

◆ currentDatabase()

QString KDbConnectionProxy::currentDatabase ( ) const

Definition at line 148 of file KDbConnectionProxy.cpp.

◆ data()

KDbConnectionData KDbConnectionProxy::data ( ) const

Definition at line 72 of file KDbConnectionProxy.cpp.

◆ databaseExists()

bool KDbConnectionProxy::databaseExists ( const QString & dbName,
bool ignoreErrors = true )

Definition at line 127 of file KDbConnectionProxy.cpp.

◆ databaseNames()

QStringList KDbConnectionProxy::databaseNames ( bool also_system_db = false)

Definition at line 122 of file KDbConnectionProxy.cpp.

◆ databaseProperties()

KDbProperties KDbConnectionProxy::databaseProperties ( ) const

Definition at line 183 of file KDbConnectionProxy.cpp.

◆ databaseVersion()

KDbVersionInfo KDbConnectionProxy::databaseVersion ( ) const

Definition at line 178 of file KDbConnectionProxy.cpp.

◆ defaultTransaction()

KDbTransaction KDbConnectionProxy::defaultTransaction ( ) const

Definition at line 220 of file KDbConnectionProxy.cpp.

◆ deleteAllRecords()

bool KDbConnectionProxy::deleteAllRecords ( KDbQuerySchema * query)

Definition at line 777 of file KDbConnectionProxy.cpp.

◆ deleteCursor()

bool KDbConnectionProxy::deleteCursor ( KDbCursor * cursor)

Definition at line 286 of file KDbConnectionProxy.cpp.

◆ deleteRecord()

bool KDbConnectionProxy::deleteRecord ( KDbQuerySchema * query,
KDbRecordData * data,
bool useRecordId = false )

Definition at line 772 of file KDbConnectionProxy.cpp.

◆ disconnect()

bool KDbConnectionProxy::disconnect ( )

Definition at line 117 of file KDbConnectionProxy.cpp.

◆ driver()

KDbDriver * KDbConnectionProxy::driver ( ) const

Definition at line 77 of file KDbConnectionProxy.cpp.

◆ dropDatabase()

bool KDbConnectionProxy::dropDatabase ( const QString & dbName = QString())

Definition at line 153 of file KDbConnectionProxy.cpp.

◆ dropQuery() [1/2]

bool KDbConnectionProxy::dropQuery ( const QString & queryName)

Definition at line 482 of file KDbConnectionProxy.cpp.

◆ dropQuery() [2/2]

bool KDbConnectionProxy::dropQuery ( KDbQuerySchema * querySchema)

Definition at line 477 of file KDbConnectionProxy.cpp.

◆ dropTable() [1/2]

tristate KDbConnectionProxy::dropTable ( const QString & tableName)

Definition at line 461 of file KDbConnectionProxy.cpp.

◆ dropTable() [2/2]

tristate KDbConnectionProxy::dropTable ( KDbTableSchema * tableSchema)

Definition at line 456 of file KDbConnectionProxy.cpp.

◆ dropTableInternal()

tristate KDbConnectionProxy::dropTableInternal ( KDbTableSchema * tableSchema,
bool alsoRemoveSchema )

Definition at line 626 of file KDbConnectionProxy.cpp.

◆ drv_afterInsert()

bool KDbConnectionProxy::drv_afterInsert ( const QString & tableName,
KDbFieldList * fields )
overridevirtual

Postprocessing (if any) required by drivers before execution of an Insert statement. Reimplement this method in your driver if there are any special processing steps to be executed after an Insert statement.

See also
drv_beforeInsert()

Reimplemented from KDbConnection.

Definition at line 712 of file KDbConnectionProxy.cpp.

◆ drv_afterUpdate()

bool KDbConnectionProxy::drv_afterUpdate ( const QString & tableName,
KDbFieldList * fields )
overridevirtual

Postprocessing required by drivers before execution of an Insert statement. Reimplement this method in your driver if there are any special processing steps to be executed after an Update statement.

See also
drv_beforeUpdate()

Reimplemented from KDbConnection.

Definition at line 722 of file KDbConnectionProxy.cpp.

◆ drv_alterTableName()

bool KDbConnectionProxy::drv_alterTableName ( KDbTableSchema * tableSchema,
const QString & newName )
overridevirtual

Alters table's described tableSchema name to newName. This is the default implementation, using "ALTER TABLE <oldname> RENAME TO <newname>", what's supported by SQLite >= 3.2, PostgreSQL, MySQL. Backends lacking ALTER TABLE, for example SQLite, reimplement this with by an inefficient data copying to a new table. In any case, renaming is performed at the backend. It's good idea to keep the operation within a transaction.

Returns
true on success.

Reimplemented from KDbConnection.

Definition at line 610 of file KDbConnectionProxy.cpp.

◆ drv_beforeInsert()

bool KDbConnectionProxy::drv_beforeInsert ( const QString & tableName,
KDbFieldList * fields )
overridevirtual

Preprocessing (if any) required by drivers before execution of an Insert statement. Reimplement this method in your driver if there are any special processing steps to be executed before an Insert statement.

See also
drv_afterInsert()

Reimplemented from KDbConnection.

Definition at line 707 of file KDbConnectionProxy.cpp.

◆ drv_beforeUpdate()

bool KDbConnectionProxy::drv_beforeUpdate ( const QString & tableName,
KDbFieldList * fields )
overridevirtual

Preprocessing required by drivers before execution of an Update statement. Reimplement this method in your driver if there are any special processing steps to be executed before an Update statement.

See also
drv_afterUpdate()

Reimplemented from KDbConnection.

Definition at line 717 of file KDbConnectionProxy.cpp.

◆ drv_beginTransaction()

KDbTransactionData * KDbConnectionProxy::drv_beginTransaction ( )
overridevirtual

Note for driver developers: begins new transaction and returns handle to it. Default implementation just executes "BEGIN" sql statement and returns just empty data (KDbTransactionData object). Ownership of the returned object is passed to the caller.

Drivers that do not support transactions (see KDbDriver::features()) do never call this method. Reimplement this method if you need to do something more (e.g. if you driver will support multiple transactions per connection). Make subclass of KDbTransactionData (declared in KDbTransaction.h) and return object of this subclass. nullptr should be returned on error. Do not check anything in connection (isConnected(), etc.) - all is already done.

Todo
Add support for nested transactions, e.g. KDbTransactionData* beginTransaction(KDbTransactionData *parent)

Reimplemented from KDbConnection.

Definition at line 692 of file KDbConnectionProxy.cpp.

◆ drv_closeDatabase()

bool KDbConnectionProxy::drv_closeDatabase ( )
overridevirtual

For implementation: closes previously opened database using connection.

Implements KDbConnection.

Definition at line 672 of file KDbConnectionProxy.cpp.

◆ drv_commitTransaction()

bool KDbConnectionProxy::drv_commitTransaction ( KDbTransactionData * trans)
overridevirtual

Note for driver developers: begins new transaction and returns handle to it. Default implementation just executes "COMMIT" sql statement and returns true on success.

See also
drv_beginTransaction()

Reimplemented from KDbConnection.

Definition at line 697 of file KDbConnectionProxy.cpp.

◆ drv_connect()

bool KDbConnectionProxy::drv_connect ( )
overridevirtual

For implementation: connects to database.

Returns
true on success.

Implements KDbConnection.

Definition at line 579 of file KDbConnectionProxy.cpp.

◆ drv_containsTable()

tristate KDbConnectionProxy::drv_containsTable ( const QString & tableName)
overridevirtual

LOW LEVEL METHOD. For implementation: returns true if table with name tableName exists in the database.

Returns
false if it does not exist or cancelled if error occurred. The lookup is case insensitive.

Implements KDbConnection.

Definition at line 600 of file KDbConnectionProxy.cpp.

◆ drv_copyTableData()

bool KDbConnectionProxy::drv_copyTableData ( const KDbTableSchema & tableSchema,
const KDbTableSchema & destinationTableSchema )
overridevirtual

Copies table data from tableSchema to destinationTableSchema Default implementation executes "INSERT INTO .. SELECT * FROM .."

Returns
true on success.

Reimplemented from KDbConnection.

Definition at line 615 of file KDbConnectionProxy.cpp.

◆ drv_createDatabase()

bool KDbConnectionProxy::drv_createDatabase ( const QString & dbName = QString())
overridevirtual

For implementation: creates new database using connection

Implements KDbConnection.

Definition at line 661 of file KDbConnectionProxy.cpp.

◆ drv_createTable() [1/2]

bool KDbConnectionProxy::drv_createTable ( const KDbTableSchema & tableSchema)
overridevirtual

Creates table using tableSchema information.

Returns
true on success.

Default implementation builds a statement using createTableStatement() and calls executeSql(). Note for driver developers: reimplement this only to perform creation in other way.

Reimplemented from KDbConnection.

Definition at line 605 of file KDbConnectionProxy.cpp.

◆ drv_createTable() [2/2]

bool KDbConnectionProxy::drv_createTable ( const QString & tableName)
overridevirtual

Creates table named by tableName. Schema object must be on schema tables' list before calling this method (otherwise false if returned). Just uses drv_createTable( const KDbTableSchema& tableSchema ). Used internally, e.g. in createDatabase().

Returns
true on success

Reimplemented from KDbConnection.

Definition at line 687 of file KDbConnectionProxy.cpp.

◆ drv_databaseExists()

bool KDbConnectionProxy::drv_databaseExists ( const QString & dbName,
bool ignoreErrors = true )
overridevirtual

For optional reimplementation: asks server if database dbName exists. This method is used internally in databaseExists(). The default implementation calls databaseNames and checks if that list contains dbName. If you need to ask the server specifically if a database exists, eg. if you can't retrieve a list of all available database names, please reimplement this method and do all needed checks.

See databaseExists() description for details about ignoreErrors argument. You should use it properly in your implementation.

Note: This method should also work if there is already database used (with useDatabase()); in this situation no changes should be made in current database selection.

Reimplemented from KDbConnection.

Definition at line 656 of file KDbConnectionProxy.cpp.

◆ drv_disconnect()

bool KDbConnectionProxy::drv_disconnect ( )
overridevirtual

For implementation: disconnects database

Returns
true on success.

Implements KDbConnection.

Definition at line 584 of file KDbConnectionProxy.cpp.

◆ drv_dropDatabase()

bool KDbConnectionProxy::drv_dropDatabase ( const QString & dbName = QString())
overridevirtual

For implementation: drops database from the server using connection. After drop, database shouldn't be accessible anymore.

Implements KDbConnection.

Definition at line 682 of file KDbConnectionProxy.cpp.

◆ drv_dropTable()

bool KDbConnectionProxy::drv_dropTable ( const QString & tableName)
overridevirtual

Physically drops table named with name. Default impelmentation executes "DROP TABLE.." command, so you rarely want to change this.

Reimplemented from KDbConnection.

Definition at line 621 of file KDbConnectionProxy.cpp.

◆ drv_executeSql()

bool KDbConnectionProxy::drv_executeSql ( const KDbEscapedString & sql)
overridevirtual

Executes query for a raw SQL statement sql without returning resulting records.

It is useful mostly for INSERT queries but it is possible to execute SELECT queries when returned records can be ignored. The @sql should be is valid and properly escaped.

Note
Only use this method if you really need.
See also
executeSql

Implements KDbConnection.

Definition at line 646 of file KDbConnectionProxy.cpp.

◆ drv_getDatabasesList()

bool KDbConnectionProxy::drv_getDatabasesList ( QStringList * list)
overridevirtual

For reimplementation: loads list of databases' names available for this connection and adds these names to list. If your server is not able to offer such a list, consider reimplementing drv_databaseExists() instead. The method should return true only if there was no error on getting database names list from the server. Default implementation puts empty list into list and returns true.

See also
databaseNames

Reimplemented from KDbConnection.

Definition at line 651 of file KDbConnectionProxy.cpp.

◆ drv_getServerVersion()

bool KDbConnectionProxy::drv_getServerVersion ( KDbServerVersionInfo * version)
overridevirtual

For implementation: Sets version to real server's version. Depending on backend type this method is called after (if KDbDriverBehavior::USING_DATABASE_REQUIRED_TO_CONNECT is true) or before database is used (if KDbDriverBehavior::USING_DATABASE_REQUIRED_TO_CONNECT is false), i.e. for PostgreSQL it is called after. In any case it is called after successful drv_connect().

Returns
true on success.

Implements KDbConnection.

Definition at line 589 of file KDbConnectionProxy.cpp.

◆ drv_getTableNames()

QStringList KDbConnectionProxy::drv_getTableNames ( bool * ok)
overridevirtual
Since
3.2

Reimplemented from KDbConnection.

Definition at line 594 of file KDbConnectionProxy.cpp.

◆ drv_isDatabaseUsed()

bool KDbConnectionProxy::drv_isDatabaseUsed ( ) const
overridevirtual
Returns
true if internal driver's structure is still in opened/connected state and database is used. Note for driver developers: Put here every test that you can do using your internal engine's database API, eg (a bit schematic): my_connection_struct->isConnected()==true. Do not check things like KDbConnection::isDatabaseUsed() here or other things that "KDb already knows" at its level. If you cannot test anything, just leave default implementation (that returns true).

Result of this method is used as an additional chance to check for isDatabaseUsed(). Do not call this method from your driver's code, it should be used at KDb level only.

Reimplemented from KDbConnection.

Definition at line 677 of file KDbConnectionProxy.cpp.

◆ drv_prepareSql()

KDbSqlResult * KDbConnectionProxy::drv_prepareSql ( const KDbEscapedString & sql)
overridevirtual

Prepares query for a raw SQL statement sql with possibility of returning records.

It is useful mostly for SELECT queries. While INSERT queries do not return records, the KDbSqlResult object offers KDbSqlResult::lastInsertRecordId(). The @sql should be is valid and properly escaped. Only use this method if you really need. For low-level access to the results (without cursors). The result may be not stored (not buffered) yet. Use KDbSqlResult::fetchRecord() to fetch each record.

Returns
Null pointer if there is no proper result or error. Ownership of the returned object is passed to the caller.
See also
prepareSql

Implements KDbConnection.

Definition at line 641 of file KDbConnectionProxy.cpp.

◆ drv_rollbackTransaction()

bool KDbConnectionProxy::drv_rollbackTransaction ( KDbTransactionData * trans)
overridevirtual

Note for driver developers: begins new transaction and returns handle to it. Default implementation just executes "ROLLBACK" sql statement and returns true on success.

See also
drv_beginTransaction()

Reimplemented from KDbConnection.

Definition at line 702 of file KDbConnectionProxy.cpp.

◆ drv_setAutoCommit()

bool KDbConnectionProxy::drv_setAutoCommit ( bool on)
overridevirtual

Changes autocommiting option for established connection.

Returns
true on success.

Note for driver developers: reimplement this only if your engine allows to set special auto commit option (like "SET AUTOCOMMIT=.." in MySQL). If not, auto commit behavior will be simulated if at least single transactions per connection are supported by the engine. Do not set any internal flags for autocommiting – it is already done inside setAutoCommit().

Default implementation does nothing with connection, just returns true.

See also
drv_beginTransaction(), autoCommit(), setAutoCommit()

Reimplemented from KDbConnection.

Definition at line 727 of file KDbConnectionProxy.cpp.

◆ drv_useDatabase()

bool KDbConnectionProxy::drv_useDatabase ( const QString & dbName = QString(),
bool * cancelled = nullptr,
KDbMessageHandler * msgHandler = nullptr )
overridevirtual

For implementation: opens existing database using connection

Returns
true on success, false on failure; sets cancelled to true if this action has been cancelled.

Implements KDbConnection.

Definition at line 666 of file KDbConnectionProxy.cpp.

◆ escapeIdentifier()

QString KDbConnectionProxy::escapeIdentifier ( const QString & id) const
overridevirtual

Identifier escaping function in the associated KDbDriver.

Calls the identifier escaping function in this connection to escape table and column names. This should be used when explicitly constructing SQL strings (e.g. "FROM " + escapeIdentifier(tablename)). It should not be used for other functions (e.g. don't do useDatabase(escapeIdentifier(database))), because the identifier will be escaped when the called function generates, for example, "USE " + escapeIdentifier(database).

For efficiency, KDb "system" tables (prefixed with kexi__) and columns therein are not escaped - we assume these are valid identifiers for all drivers.

Use KDbEscapedString::isValid() to check if escaping has been performed successfully. Invalid strings are set to null in addition, that is KDbEscapedString::isNull() is true, not just isEmpty().

Reimplemented from KDbConnection.

Definition at line 574 of file KDbConnectionProxy.cpp.

◆ escapeString()

KDbEscapedString KDbConnectionProxy::escapeString ( const QString & str) const
overridevirtual

Connection-specific string escaping. Default implementation uses driver's escaping. Use KDbEscapedString::isValid() to check if escaping has been performed successfully. Invalid strings are set to null in addition, that is KDbEscapedString::isNull() is true, not just isEmpty().

Reimplemented from KDbConnection.

Definition at line 245 of file KDbConnectionProxy.cpp.

◆ executeQuery() [1/4]

KDbCursor * KDbConnectionProxy::executeQuery ( const KDbEscapedString & sql,
KDbCursor::Options options = KDbCursor::Option::None )

Definition at line 265 of file KDbConnectionProxy.cpp.

◆ executeQuery() [2/4]

KDbCursor * KDbConnectionProxy::executeQuery ( KDbQuerySchema * query,
const QList< QVariant > & params,
KDbCursor::Options options = KDbCursor::Option::None )

Definition at line 270 of file KDbConnectionProxy.cpp.

◆ executeQuery() [3/4]

KDbCursor * KDbConnectionProxy::executeQuery ( KDbQuerySchema * query,
KDbCursor::Options options = KDbCursor::Option::None )

Definition at line 276 of file KDbConnectionProxy.cpp.

◆ executeQuery() [4/4]

KDbCursor * KDbConnectionProxy::executeQuery ( KDbTableSchema * table,
KDbCursor::Options options = KDbCursor::Option::None )

Definition at line 281 of file KDbConnectionProxy.cpp.

◆ executeQueryInternal()

KDbCursor * KDbConnectionProxy::executeQueryInternal ( const KDbEscapedString & sql,
KDbQuerySchema * query,
const QList< QVariant > * params )

Definition at line 815 of file KDbConnectionProxy.cpp.

◆ executeSql()

bool KDbConnectionProxy::executeSql ( const KDbEscapedString & sql)

Definition at line 517 of file KDbConnectionProxy.cpp.

◆ findSystemFieldName()

KDbField * KDbConnectionProxy::findSystemFieldName ( const KDbFieldList & fieldlist)

Definition at line 492 of file KDbConnectionProxy.cpp.

◆ insertRecord() [1/3]

bool KDbConnectionProxy::insertRecord ( KDbFieldList * fields,
const QList< QVariant > & values )

Definition at line 436 of file KDbConnectionProxy.cpp.

◆ insertRecord() [2/3]

bool KDbConnectionProxy::insertRecord ( KDbQuerySchema * query,
KDbRecordData * data,
KDbRecordEditBuffer * buf,
bool getRecordId = false )

Definition at line 767 of file KDbConnectionProxy.cpp.

◆ insertRecord() [3/3]

H_INS_REC_ALL bool KDbConnectionProxy::insertRecord ( KDbTableSchema * tableSchema,
const QList< QVariant > & values )

Definition at line 431 of file KDbConnectionProxy.cpp.

◆ isConnected()

bool KDbConnectionProxy::isConnected ( ) const

Definition at line 87 of file KDbConnectionProxy.cpp.

◆ isDatabaseUsed()

bool KDbConnectionProxy::isDatabaseUsed ( ) const

Definition at line 92 of file KDbConnectionProxy.cpp.

◆ isEmpty()

tristate KDbConnectionProxy::isEmpty ( KDbTableSchema * table)

Definition at line 393 of file KDbConnectionProxy.cpp.

◆ isInternalTableSchema()

bool KDbConnectionProxy::isInternalTableSchema ( const QString & tableName)

Definition at line 569 of file KDbConnectionProxy.cpp.

◆ loadDataBlock()

tristate KDbConnectionProxy::loadDataBlock ( int objectID,
QString * dataString,
const QString & dataID = QString() )

Definition at line 542 of file KDbConnectionProxy.cpp.

◆ loadExtendedTableSchemaData()

bool KDbConnectionProxy::loadExtendedTableSchemaData ( KDbTableSchema * tableSchema)

Definition at line 821 of file KDbConnectionProxy.cpp.

◆ loadObjectData() [1/2]

tristate KDbConnectionProxy::loadObjectData ( int type,
const QString & name,
KDbObject * object )

Definition at line 537 of file KDbConnectionProxy.cpp.

◆ loadObjectData() [2/2]

tristate KDbConnectionProxy::loadObjectData ( int type,
int id,
KDbObject * object )
Since
3.1

Definition at line 532 of file KDbConnectionProxy.cpp.

◆ objectIds()

QList< int > KDbConnectionProxy::objectIds ( int objectType,
bool * ok = nullptr )

Definition at line 198 of file KDbConnectionProxy.cpp.

◆ objectNames()

QStringList KDbConnectionProxy::objectNames ( int objectType = KDb::AnyObjectType,
bool * ok = nullptr )

Definition at line 158 of file KDbConnectionProxy.cpp.

◆ options()

KDbConnectionOptions * KDbConnectionProxy::options ( )

Definition at line 97 of file KDbConnectionProxy.cpp.

◆ parentConnection() [1/2]

KDbConnection * KDbConnectionProxy::parentConnection ( )
Returns
parent connection for this proxy

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 57 of file KDbConnectionProxy.cpp.

◆ parentConnection() [2/2]

const KDbConnection * KDbConnectionProxy::parentConnection ( ) const

Definition at line 62 of file KDbConnectionProxy.cpp.

◆ prepareQuery() [1/3]

KDbCursor * KDbConnectionProxy::prepareQuery ( const KDbEscapedString & sql,
KDbCursor::Options options = KDbCursor::Option::None )
overridevirtual

Prepares SELECT query described by a raw statement sql.

Returns
opened cursor created for results of this query or nullptr if there was any error. Ownership of the returned object is passed to the caller. KDbCursor can have optionally applied options (one of more selected from KDbCursor::Options). Preparation means that returned cursor is created but not opened. Open this when you would like to do it with KDbCursor::open().

Note for driver developers: you should initialize cursor engine-specific resources and return KDbCursor subclass' object (passing sql and options to its constructor).

Implements KDbConnection.

Definition at line 250 of file KDbConnectionProxy.cpp.

◆ prepareQuery() [2/3]

KDbCursor * KDbConnectionProxy::prepareQuery ( KDbQuerySchema * query,
KDbCursor::Options options = KDbCursor::Option::None )
overridevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Prepares query described by query schema without parameters.

Implements KDbConnection.

Definition at line 255 of file KDbConnectionProxy.cpp.

◆ prepareQuery() [3/3]

KDbCursor * KDbConnectionProxy::prepareQuery ( KDbTableSchema * table,
KDbCursor::Options options = KDbCursor::Option::None )

Definition at line 260 of file KDbConnectionProxy.cpp.

◆ prepareSql()

QSharedPointer< KDbSqlResult > KDbConnectionProxy::prepareSql ( const KDbEscapedString & sql)

Definition at line 512 of file KDbConnectionProxy.cpp.

◆ prepareStatement()

KDbPreparedStatement KDbConnectionProxy::prepareStatement ( KDbPreparedStatement::Type type,
KDbFieldList * fields,
const QStringList & whereFieldNames = QStringList() )

Definition at line 563 of file KDbConnectionProxy.cpp.

◆ prepareStatementInternal()

KDbPreparedStatementInterface * KDbConnectionProxy::prepareStatementInternal ( )
overridevirtual

Prepare an SQL statement and return a KDbPreparedStatementInterface-derived object. Ownership of the returned object is passed to the caller.

Implements KDbConnection.

Definition at line 732 of file KDbConnectionProxy.cpp.

◆ queryIds()

QList< int > KDbConnectionProxy::queryIds ( bool * ok = nullptr)

Definition at line 193 of file KDbConnectionProxy.cpp.

◆ querySchema() [1/2]

KDbQuerySchema * KDbConnectionProxy::querySchema ( const QString & queryName)

Definition at line 306 of file KDbConnectionProxy.cpp.

◆ querySchema() [2/2]

KDbQuerySchema * KDbConnectionProxy::querySchema ( int queryId)

Definition at line 301 of file KDbConnectionProxy.cpp.

◆ querySingleNumber() [1/3]

tristate KDbConnectionProxy::querySingleNumber ( const KDbEscapedString & sql,
int * number,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 353 of file KDbConnectionProxy.cpp.

◆ querySingleNumber() [2/3]

tristate KDbConnectionProxy::querySingleNumber ( KDbQuerySchema * query,
int * number,
const QList< QVariant > & params,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 365 of file KDbConnectionProxy.cpp.

◆ querySingleNumber() [3/3]

tristate KDbConnectionProxy::querySingleNumber ( KDbQuerySchema * query,
int * number,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 359 of file KDbConnectionProxy.cpp.

◆ querySingleNumberInternal()

tristate KDbConnectionProxy::querySingleNumberInternal ( const KDbEscapedString * sql,
int * number,
KDbQuerySchema * query,
const QList< QVariant > * params,
int column,
QueryRecordOptions options )

Definition at line 801 of file KDbConnectionProxy.cpp.

◆ querySingleRecord() [1/3]

tristate KDbConnectionProxy::querySingleRecord ( const KDbEscapedString & sql,
KDbRecordData * data,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 316 of file KDbConnectionProxy.cpp.

◆ querySingleRecord() [2/3]

tristate KDbConnectionProxy::querySingleRecord ( KDbQuerySchema * query,
KDbRecordData * data,
const QList< QVariant > & params,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 328 of file KDbConnectionProxy.cpp.

◆ querySingleRecord() [3/3]

tristate KDbConnectionProxy::querySingleRecord ( KDbQuerySchema * query,
KDbRecordData * data,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 322 of file KDbConnectionProxy.cpp.

◆ querySingleRecordInternal()

tristate KDbConnectionProxy::querySingleRecordInternal ( KDbRecordData * data,
const KDbEscapedString * sql,
KDbQuerySchema * query,
const QList< QVariant > * params,
QueryRecordOptions options )

Definition at line 787 of file KDbConnectionProxy.cpp.

◆ querySingleString() [1/3]

tristate KDbConnectionProxy::querySingleString ( const KDbEscapedString & sql,
QString * value,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 334 of file KDbConnectionProxy.cpp.

◆ querySingleString() [2/3]

tristate KDbConnectionProxy::querySingleString ( KDbQuerySchema * query,
QString * value,
const QList< QVariant > & params,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 346 of file KDbConnectionProxy.cpp.

◆ querySingleString() [3/3]

tristate KDbConnectionProxy::querySingleString ( KDbQuerySchema * query,
QString * value,
int column = 0,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 340 of file KDbConnectionProxy.cpp.

◆ querySingleStringInternal()

tristate KDbConnectionProxy::querySingleStringInternal ( const KDbEscapedString * sql,
QString * value,
KDbQuerySchema * query,
const QList< QVariant > * params,
int column,
QueryRecordOptions options )

Definition at line 794 of file KDbConnectionProxy.cpp.

◆ queryStringList() [1/3]

bool KDbConnectionProxy::queryStringList ( const KDbEscapedString & sql,
QStringList * list,
int column = 0 )

Definition at line 372 of file KDbConnectionProxy.cpp.

◆ queryStringList() [2/3]

bool KDbConnectionProxy::queryStringList ( KDbQuerySchema * query,
QStringList * list,
const QList< QVariant > & params,
int column = 0 )

Definition at line 382 of file KDbConnectionProxy.cpp.

◆ queryStringList() [3/3]

bool KDbConnectionProxy::queryStringList ( KDbQuerySchema * query,
QStringList * list,
int column = 0 )

Definition at line 377 of file KDbConnectionProxy.cpp.

◆ queryStringListInternal()

bool KDbConnectionProxy::queryStringListInternal ( const KDbEscapedString * sql,
QStringList * list,
KDbQuerySchema * query,
const QList< QVariant > * params,
int column,
bool(* filterFunction )(const QString &) )

Definition at line 808 of file KDbConnectionProxy.cpp.

◆ recentSqlString()

KDbEscapedString KDbConnectionProxy::recentSqlString ( ) const
overridevirtual

Return recently used SQL string.

If there was a successful query execution it is equal to result().sql(), otherwise it is equal to result().errorSql().

Reimplemented from KDbConnection.

Definition at line 398 of file KDbConnectionProxy.cpp.

◆ removeDataBlock()

bool KDbConnectionProxy::removeDataBlock ( int objectID,
const QString & dataID = QString() )

Definition at line 558 of file KDbConnectionProxy.cpp.

◆ removeObject()

bool KDbConnectionProxy::removeObject ( int objId)

Definition at line 487 of file KDbConnectionProxy.cpp.

◆ result()

KDbResult KDbConnectionProxy::result ( ) const

Definition at line 107 of file KDbConnectionProxy.cpp.

◆ resultable()

KDbResultable KDbConnectionProxy::resultable ( ) const

Definition at line 112 of file KDbConnectionProxy.cpp.

◆ resultExists()

tristate KDbConnectionProxy::resultExists ( const KDbEscapedString & sql,
QueryRecordOptions options = QueryRecordOption::Default )

Definition at line 388 of file KDbConnectionProxy.cpp.

◆ rollbackAutoCommitTransaction()

bool KDbConnectionProxy::rollbackAutoCommitTransaction ( const KDbTransaction & trans)

Definition at line 747 of file KDbConnectionProxy.cpp.

◆ rollbackTransaction()

bool KDbConnectionProxy::rollbackTransaction ( KDbTransaction trans = KDbTransaction(),
KDbTransaction::CommitOptions options = KDbTransaction::CommitOptions() )

Definition at line 214 of file KDbConnectionProxy.cpp.

◆ serverVersion()

KDbServerVersionInfo KDbConnectionProxy::serverVersion ( ) const

Definition at line 173 of file KDbConnectionProxy.cpp.

◆ setAutoCommit()

bool KDbConnectionProxy::setAutoCommit ( bool on)

Definition at line 240 of file KDbConnectionProxy.cpp.

◆ setAvailableDatabaseName()

void KDbConnectionProxy::setAvailableDatabaseName ( const QString & dbName)

Definition at line 502 of file KDbConnectionProxy.cpp.

◆ setDefaultTransaction()

void KDbConnectionProxy::setDefaultTransaction ( const KDbTransaction & trans)

Definition at line 225 of file KDbConnectionProxy.cpp.

◆ setParentConnectionIsOwned()

void KDbConnectionProxy::setParentConnectionIsOwned ( bool set)

Control owhership of parent connection that is assigned to this proxy.

Owned connection is closed and destroyed upon destruction of the KDbConnectionProxy object.

Definition at line 67 of file KDbConnectionProxy.cpp.

◆ setQuerySchemaObsolete()

bool KDbConnectionProxy::setQuerySchemaObsolete ( const QString & queryName)

Definition at line 311 of file KDbConnectionProxy.cpp.

◆ setupField()

KDbField * KDbConnectionProxy::setupField ( const KDbRecordData & data)

Definition at line 636 of file KDbConnectionProxy.cpp.

◆ setupObjectData()

bool KDbConnectionProxy::setupObjectData ( const KDbRecordData & data,
KDbObject * object )

Definition at line 631 of file KDbConnectionProxy.cpp.

◆ storeDataBlock()

bool KDbConnectionProxy::storeDataBlock ( int objectID,
const QString & dataString,
const QString & dataID = QString() )

Definition at line 547 of file KDbConnectionProxy.cpp.

◆ storeExtendedTableSchemaData()

bool KDbConnectionProxy::storeExtendedTableSchemaData ( KDbTableSchema * tableSchema)

Definition at line 826 of file KDbConnectionProxy.cpp.

◆ storeMainFieldSchema()

bool KDbConnectionProxy::storeMainFieldSchema ( KDbField * field)

Definition at line 831 of file KDbConnectionProxy.cpp.

◆ storeNewObjectData()

bool KDbConnectionProxy::storeNewObjectData ( KDbObject * object)

Definition at line 527 of file KDbConnectionProxy.cpp.

◆ storeObjectData()

bool KDbConnectionProxy::storeObjectData ( KDbObject * object)

Definition at line 522 of file KDbConnectionProxy.cpp.

◆ tableIds()

QList< int > KDbConnectionProxy::tableIds ( bool * ok = nullptr)

Definition at line 188 of file KDbConnectionProxy.cpp.

◆ tableNames()

QStringList KDbConnectionProxy::tableNames ( bool alsoSystemTables = false,
bool * ok = nullptr )

Definition at line 163 of file KDbConnectionProxy.cpp.

◆ tableSchema() [1/2]

KDbTableSchema * KDbConnectionProxy::tableSchema ( const QString & tableName)

Definition at line 296 of file KDbConnectionProxy.cpp.

◆ tableSchema() [2/2]

KDbTableSchema * KDbConnectionProxy::tableSchema ( int tableId)

Definition at line 291 of file KDbConnectionProxy.cpp.

◆ transactions()

QList< KDbTransaction > KDbConnectionProxy::transactions ( )

Definition at line 230 of file KDbConnectionProxy.cpp.

◆ updateRecord()

bool KDbConnectionProxy::updateRecord ( KDbQuerySchema * query,
KDbRecordData * data,
KDbRecordEditBuffer * buf,
bool useRecordId = false )

Definition at line 762 of file KDbConnectionProxy.cpp.

◆ useDatabase()

bool KDbConnectionProxy::useDatabase ( const QString & dbName = QString(),
bool kexiCompatible = true,
bool * cancelled = nullptr,
KDbMessageHandler * msgHandler = nullptr )

Definition at line 137 of file KDbConnectionProxy.cpp.

◆ useTemporaryDatabaseIfNeeded()

bool KDbConnectionProxy::useTemporaryDatabaseIfNeeded ( QString * name)

Definition at line 507 of file KDbConnectionProxy.cpp.

Member Data Documentation

◆ H_INS_REC_ALL

KDbConnectionProxy::H_INS_REC_ALL

Definition at line 218 of file KDbConnectionProxy.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.