#include <mysqldriver.h>
Public Member Functions | |
| MySqlDriver (TQObject *parent, const char *name, const TQStringList &args=TQStringList()) | |
| virtual bool | isSystemDatabaseName (const TQString &n) const |
| virtual TQString | escapeString (const TQString &str) const |
| virtual TQCString | escapeString (const TQCString &str) const |
| virtual TQString | escapeBLOB (const TQByteArray &array) const |
Public Member Functions inherited from KexiDB::Driver | |
| Connection * | createConnection (ConnectionData &conn_data, int options=0) |
| const TQPtrList< Connection > | connectionsList () const |
| TQString | fileDBDriverMimeType () const |
| const KService * | service () const |
| bool | isFileDriver () const |
| virtual bool | isSystemObjectName (const TQString &n) const |
| bool | isSystemFieldName (const TQString &n) const |
| int | features () const |
| bool | transactionsSupported () const |
| AdminTools & | adminTools () const |
| virtual TQString | sqlTypeName (int id_t, int p=0) const |
| virtual bool | isValid () |
| virtual DatabaseVersionInfo | version () const =0 |
| virtual TQString | valueToSQL (uint ftype, const TQVariant &v) const |
| TQString | valueToSQL (const TQString &ftype, const TQVariant &v) const |
| TQString | valueToSQL (const Field *field, const TQVariant &v) const |
| virtual TQString | dateTimeToSQL (const TQDateTime &v) const |
| TQString | escapeIdentifier (const TQString &str, int options=EscapeDriver|EscapeAsNecessary) const |
| TQCString | escapeIdentifier (const TQCString &str, int options=EscapeDriver|EscapeAsNecessary) const |
| TQVariant | propertyValue (const TQCString &propName) const |
| TQString | propertyCaption (const TQCString &propName) const |
| TQValueList< TQCString > | propertyNames () const |
Public Member Functions inherited from KexiDB::Object | |
| bool | error () const |
| const TQString & | errorMsg () const |
| int | errorNum () const |
| int | previousServerResult () const |
| TQString | previousServerResultName () const |
| void | debugError () |
| virtual void | clearError () |
| virtual TQString | serverErrorMsg () |
| virtual int | serverResult () |
| virtual TQString | serverResultName () |
| TQString | msgTitle () const |
| const TQString | recentSQLString () const |
Protected Member Functions | |
| virtual TQString | drv_escapeIdentifier (const TQString &str) const |
| virtual TQCString | drv_escapeIdentifier (const TQCString &str) const |
| virtual Connection * | drv_createConnection (ConnectionData &conn_data) |
| virtual bool | drv_isSystemFieldName (const TQString &n) const |
Protected Member Functions inherited from KexiDB::Driver | |
| Driver (TQObject *parent, const char *name, const TQStringList &args=TQStringList()) | |
| virtual AdminTools * | drv_createAdminTools () const |
| Connection * | removeConnection (Connection *conn) |
| void | initSQLKeywords (int hashSize=17) |
Protected Member Functions inherited from KexiDB::Object | |
| Object (MessageHandler *handler=0) | |
| virtual void | setError (int code=ERR_OTHER, const TQString &msg=TQString()) |
| virtual void | setError (const TQString &msg) |
| virtual void | setError (const TQString &title, const TQString &msg) |
| void | setError (KexiDB::Object *obj, const TQString &prependMessage=TQString()) |
| virtual void | setError (KexiDB::Object *obj, int code, const TQString &prependMessage=TQString()) |
| virtual int | askQuestion (const TQString &message, KMessageBox::DialogType dlgType, KMessageBox::ButtonCode defaultResult, const KGuiItem &buttonYes=KStdGuiItem::yes(), const KGuiItem &buttonNo=KStdGuiItem::no(), const TQString &dontShowAskAgainName=TQString(), int options=KMessageBox::Notify, MessageHandler *msgHandler=0) |
| virtual void | drv_clearServerResult () |
Additional Inherited Members | |
Public Types inherited from KexiDB::Driver | |
| enum | Features { NoFeatures = 0 , SingleTransactions = 1 , MultipleTransactions = 2 , NestedTransactions = 4 , CursorForward = 8 , CursorBackward = (CursorForward+16) , CompactingDatabaseSupported = 32 , IgnoreTransactions = 1024 } |
| enum | CreateConnectionOptions { ReadOnlyConnection = 1 } |
| enum | EscapeType { EscapeDriver = 0x01 , EscapeKexi = 0x02 } |
| enum | EscapePolicy { EscapeAsNecessary = 0x04 , EscapeAlways = 0x08 } |
| typedef TQMap< TQString, Info > | InfoMap |
Static Public Member Functions inherited from KexiDB::Driver | |
| static TQString | defaultFileBasedDriverMimeType () |
| static TQString | defaultFileBasedDriverName () |
| static bool | isKexiDBSystemObjectName (const TQString &n) |
| static TQString | defaultSQLTypeName (int id_t) |
Protected Attributes inherited from KexiDB::Driver | |
| DriverBehaviour * | beh |
| DriverPrivate * | d |
Protected Attributes inherited from KexiDB::Object | |
| TQString | m_sql |
| TQString | m_errorSql |
| int | m_serverResult |
| TQString | m_serverResultName |
| TQString | m_serverErrorMsg |
| TQString | m_errMsg |
Detailed Description
MySQL database driver.
Definition at line 30 of file mysqldriver.h.
Constructor & Destructor Documentation
◆ MySqlDriver()
| MySqlDriver::MySqlDriver | ( | TQObject * | parent, |
| const char * | name, | ||
| const TQStringList & | args = TQStringList() |
||
| ) |
Constructor sets database features and maps the types in KexiDB::Field::Type to the MySQL types.
See: http://dev.mysql.com/doc/mysql/en/Column_types.html
Definition at line 57 of file mysqldriver.cpp.
◆ ~MySqlDriver()
|
virtual |
Definition at line 96 of file mysqldriver.cpp.
Member Function Documentation
◆ drv_createConnection()
|
protectedvirtual |
For reimplemenation: creates and returns connection object with additional structures specific for a given driver. Connection object should inherit Connection and have a destructor that descructs all allocated driver-dependent connection structures.
Implements KexiDB::Driver.
Definition at line 101 of file mysqldriver.cpp.
◆ drv_escapeIdentifier() [1/2]
|
protectedvirtual |
This is overloaded version of drv_escapeIdentifier( const TQString& str ) to be implemented in the same way.
Implements KexiDB::Driver.
Definition at line 207 of file mysqldriver.cpp.
◆ drv_escapeIdentifier() [2/2]
|
protectedvirtual |
Add back-ticks to an identifier, and replace any back-ticks within the name with single quotes.
Implements KexiDB::Driver.
Definition at line 203 of file mysqldriver.cpp.
◆ drv_isSystemFieldName()
|
protectedvirtual |
- Returns
- true if n is a system field's name, build-in system field that cannot be used or created by a user, and in most cases user even shouldn't see this. The list is specific for a given driver implementation. For implementation.
Implements KexiDB::Driver.
Definition at line 111 of file mysqldriver.cpp.
◆ escapeBLOB()
|
virtual |
◆ escapeString() [1/2]
|
virtual |
This is overloaded version of escapeString( const TQString& str ) to be implemented in the same way.
- Todo:
- optimize using mysql_real_escape_string()? see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html
Implements KexiDB::Driver.
Definition at line 188 of file mysqldriver.cpp.
◆ escapeString() [2/2]
|
virtual |
Escape a string for use as a value.
- Todo:
- support more characters, like %, _
- Todo:
- move new_string to Driver::m_new_string or so...
Implements KexiDB::Driver.
Definition at line 115 of file mysqldriver.cpp.
◆ isSystemDatabaseName()
|
virtual |
- Returns
- true if n is a system database's name, eg. name of build-in, system database that cannot be used or created by a user, and in most cases user even shouldn't see this. The list is specific for a given driver implementation. For implementation.
- See also
- isSystemObjectName().
Implements KexiDB::Driver.
Definition at line 106 of file mysqldriver.cpp.
The documentation for this class was generated from the following files:

Public Member Functions inherited from