SybaseConnection

Search for usage in LXR

#include <SybaseConnection.h>

Inheritance diagram for SybaseConnection:

Public Member Functions

KDbCursorprepareQuery (const KDbEscapedString &sql, int cursor_options=0) override
 
KDbCursorprepareQuery (KDbQuerySchema *query, int cursor_options=0) override
 
KDbPreparedStatement prepareStatement (KDbPreparedStatement::StatementType type, KDbFieldList *fields) override
 
- Public Member Functions inherited from KDbConnection
 ~KDbConnection () override
 
tristate alterTable (KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)
 
bool alterTableName (KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)
 
virtual QString anyAvailableDatabaseName ()
 
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)
 
virtual QString escapeIdentifier (const QString &id) const
 
virtual KDbEscapedString escapeString (const QString &str) const
 
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 ()
 
virtual KDbCursorprepareQuery (const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)=0
 
KDbCursorprepareQuery (KDbQuerySchema *query, const QList< QVariant > &params, KDbCursor::Options options=KDbCursor::Option::None)
 
virtual KDbCursorprepareQuery (KDbQuerySchema *query, KDbCursor::Options options=KDbCursor::Option::None)=0
 
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)
 
virtual KDbEscapedString recentSqlString () const
 
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)
 
- Public Member Functions inherited from KDbResultable
 KDbResultable (const KDbResultable &other)
 
void clearResult ()
 
KDbMessageHandlermessageHandler () const
 
KDbResultableoperator= (const KDbResultable &other)
 
KDbResult result () const
 
void setMessageHandler (KDbMessageHandler *handler)
 
void showMessage ()
 

Protected Member Functions

 SybaseConnection (KDbDriver *driver, const KDbConnectionData &connData)
 
virtual bool drv_afterInsert (const QString &table, KDbFieldList *fields)
 
virtual bool drv_afterUpdate (const QString &table, KDbFieldList *fields)
 
virtual bool drv_beforeInsert (const QString &table, KDbFieldList *fields)
 
virtual bool drv_beforeUpdate (const QString &table, KDbFieldList *fields)
 
virtual bool drv_closeDatabase ()
 
virtual bool drv_connect (KDbServerVersionInfo *version)
 
virtual bool drv_containsTable (const QString &tableName)
 
virtual bool drv_createDatabase (const QString &dbName=QString())
 
virtual bool drv_disconnect ()
 
virtual bool drv_dropDatabase (const QString &dbName=QString())
 
virtual bool drv_executeSql (const KDbEscapedString &sql)
 
virtual bool drv_getDatabasesList (QStringList *list)
 
virtual bool drv_getTablesList (QStringList *list)
 
virtual quint64 drv_lastInsertRecordId ()
 
virtual bool drv_useDatabase (const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
 
virtual QString serverResultName () const
 
- 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 bool drv_alterTableName (KDbTableSchema *tableSchema, const QString &newName)
 
virtual KDbTransactionDatadrv_beginTransaction ()
 
virtual tristate drv_changeFieldProperty (KDbTableSchema *table, KDbField *field, const QString &propertyName, const QVariant &value)
 
virtual bool drv_commitTransaction (KDbTransactionData *trans)
 
virtual bool drv_connect ()=0
 
virtual bool drv_copyTableData (const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema)
 
virtual bool drv_createTable (const KDbTableSchema &tableSchema)
 
virtual bool drv_createTable (const QString &tableName)
 
virtual bool drv_databaseExists (const QString &dbName, bool ignoreErrors=true)
 
virtual bool drv_dropTable (const QString &tableName)
 
virtual bool drv_getServerVersion (KDbServerVersionInfo *version)=0
 
virtual QStringList drv_getTableNames (bool *ok)
 
virtual bool drv_isDatabaseUsed () const
 
virtual KDbSqlResultdrv_prepareSql (const KDbEscapedString &sql)=0
 
virtual bool drv_rollbackTransaction (KDbTransactionData *trans)
 
virtual bool drv_setAutoCommit (bool on)
 
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)
 
virtual KDbPreparedStatementInterfaceprepareStatementInternal ()=0
 
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)
 

Protected Attributes

SybaseConnectionInternal * d
 
- Protected Attributes inherited from KDbResultable
Private *const d
 
KDbResult m_result
 

Additional Inherited Members

- Public 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
 
- Static Public Member Functions inherited from KDbConnection
static QStringList kdbSystemTableNames ()
 
- Public Attributes inherited from KDbConnection
 H_INS_REC_ALL
 

Detailed Description

Provides database connection, allowing queries and data modification.

Definition at line 32 of file SybaseConnection.h.

Constructor & Destructor Documentation

◆ ~SybaseConnection()

SybaseConnection::~SybaseConnection ( )
virtual

Definition at line 36 of file SybaseConnection.cpp.

◆ SybaseConnection()

SybaseConnection::SybaseConnection ( KDbDriver * driver,
const KDbConnectionData & connData )
protected

Used by driver

Definition at line 30 of file SybaseConnection.cpp.

Member Function Documentation

◆ drv_afterInsert()

virtual bool SybaseConnection::drv_afterInsert ( const QString & tableName,
KDbFieldList * fields )
protectedvirtual

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.

◆ drv_afterUpdate()

virtual bool SybaseConnection::drv_afterUpdate ( const QString & tableName,
KDbFieldList * fields )
protectedvirtual

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.

◆ drv_beforeInsert()

virtual bool SybaseConnection::drv_beforeInsert ( const QString & tableName,
KDbFieldList * fields )
protectedvirtual

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.

◆ drv_beforeUpdate()

virtual bool SybaseConnection::drv_beforeUpdate ( const QString & tableName,
KDbFieldList * fields )
protectedvirtual

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.

◆ drv_closeDatabase()

bool SybaseConnection::drv_closeDatabase ( )
protectedvirtual

For implementation: closes previously opened database using connection.

Implements KDbConnection.

Definition at line 117 of file SybaseConnection.cpp.

◆ drv_connect()

bool SybaseConnection::drv_connect ( KDbServerVersionInfo * version)
protectedvirtual

Definition at line 41 of file SybaseConnection.cpp.

◆ drv_containsTable()

bool SybaseConnection::drv_containsTable ( const QString & tableName)
protectedvirtual
Todo
move this somewhere to low level class (MIGRATION?)

Implements KDbConnection.

Definition at line 158 of file SybaseConnection.cpp.

◆ drv_createDatabase()

bool SybaseConnection::drv_createDatabase ( const QString & dbName = QString())
protectedvirtual

For implementation: creates new database using connection

Implements KDbConnection.

Definition at line 94 of file SybaseConnection.cpp.

◆ drv_disconnect()

bool SybaseConnection::drv_disconnect ( )
protectedvirtual

For implementation: disconnects database

Returns
true on success.

Implements KDbConnection.

Definition at line 72 of file SybaseConnection.cpp.

◆ drv_dropDatabase()

bool SybaseConnection::drv_dropDatabase ( const QString & dbName = QString())
protectedvirtual

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

Implements KDbConnection.

Definition at line 123 of file SybaseConnection.cpp.

◆ drv_executeSql()

bool SybaseConnection::drv_executeSql ( const KDbEscapedString & sql)
protectedvirtual

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 129 of file SybaseConnection.cpp.

◆ drv_getDatabasesList()

bool SybaseConnection::drv_getDatabasesList ( QStringList * list)
protectedvirtual

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 87 of file SybaseConnection.cpp.

◆ drv_getTablesList()

bool SybaseConnection::drv_getTablesList ( QStringList * list)
protectedvirtual
Todo
move this somewhere to low level class (MIGRATION?)

Definition at line 164 of file SybaseConnection.cpp.

◆ drv_lastInsertRecordId()

quint64 SybaseConnection::drv_lastInsertRecordId ( )
protectedvirtual

Definition at line 134 of file SybaseConnection.cpp.

◆ drv_useDatabase()

bool SybaseConnection::drv_useDatabase ( const QString & dbName = QString(),
bool * cancelled = 0,
KDbMessageHandler * msgHandler = 0 )
protectedvirtual

For implementation: opens existing database using connection

Returns
true on success, false on failure; sets cancelled to true if this action has been cancelled.
Todo
is here escaping needed?

Implements KDbConnection.

Definition at line 108 of file SybaseConnection.cpp.

◆ prepareQuery() [1/2]

KDbCursor * SybaseConnection::prepareQuery ( const KDbEscapedString & sql,
int cursor_options = 0 )
override

Definition at line 77 of file SybaseConnection.cpp.

◆ prepareQuery() [2/2]

KDbCursor * SybaseConnection::prepareQuery ( KDbQuerySchema * query,
int cursor_options = 0 )
override

Definition at line 82 of file SybaseConnection.cpp.

◆ prepareStatement()

KDbPreparedStatement SybaseConnection::prepareStatement ( KDbPreparedStatement::StatementType type,
KDbFieldList * fields )
override

Definition at line 169 of file SybaseConnection.cpp.

◆ serverResultName()

QString SybaseConnection::serverResultName ( ) const
protectedvirtual

Implemented for KDbResultable.

Reimplemented from KDbResultable.

Definition at line 146 of file SybaseConnection.cpp.

Member Data Documentation

◆ d

SybaseConnectionInternal* SybaseConnection::d
protected

Definition at line 76 of file SybaseConnection.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 Sat Dec 21 2024 17:00:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.