PostgresqlDriver
#include <PostgresqlDriver.h>
Static Public Member Functions | |
static int | pqfmodToLength (int pqfmod) |
static KDbField::Type | typeForSize (KDbField::Type t, int pqfmod, int *maxTextLength) |
Static Public Member Functions inherited from KDbDriver | |
static QString | defaultSqlTypeName (KDbField::Type type) |
static bool | isKDbSystemObjectName (const QString &name) |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
KDbConnection * | drv_createConnection (const KDbConnectionData &connData, const KDbConnectionOptions &options) override |
QByteArray | drv_escapeIdentifier (const QByteArray &str) const override |
QString | drv_escapeIdentifier (const QString &str) const override |
bool | drv_isSystemFieldName (const QString &name) const override |
Protected Member Functions inherited from KDbDriver | |
KDbDriver (QObject *parent, const QVariantList &args) | |
virtual KDbEscapedString | addLimitTo1 (const KDbEscapedString &sql, bool add=true) |
KDbDriverBehavior * | behavior () |
const KDbDriverBehavior * | behavior () const |
virtual KDbAdminTools * | drv_createAdminTools () const |
void | initDriverSpecificKeywords (const char *const *keywords) |
virtual bool | isValid () |
KDbConnection * | removeConnection (KDbConnection *conn) |
void | setMetaData (const KDbDriverMetaData *metaData) |
virtual bool | supportsDefaultValue (const KDbField &field) const |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Public Types inherited from KDbDriver | |
enum | Features { NoFeatures = 0 , SingleTransactions = 1 , MultipleTransactions = 2 , NestedTransactions = 4 , CursorForward = 8 , CursorBackward = (CursorForward + 16) , CompactingDatabaseSupported = 32 , IgnoreTransactions = 1024 } |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
Protected Attributes inherited from KDbDriver | |
KDbDriverPrivate *const | d |
Protected Attributes inherited from KDbResultable | |
Private *const | d |
KDbResult | m_result |
Detailed Description
PostgreSQL database driver.
Definition at line 29 of file PostgresqlDriver.h.
Constructor & Destructor Documentation
◆ PostgresqlDriver()
PostgresqlDriver::PostgresqlDriver | ( | QObject * | parent, |
const QVariantList & | args ) |
◆ ~PostgresqlDriver()
|
override |
Definition at line 89 of file PostgresqlDriver.cpp.
Member Function Documentation
◆ drv_createConnection()
|
overrideprotectedvirtual |
For reimplementation: creates and returns connection object with additional structures specific for a given driver. KDbConnection object should inherit KDbConnection and have a destructor that descructs all allocated driver-dependent connection structures.
Implements KDbDriver.
Definition at line 106 of file PostgresqlDriver.cpp.
◆ drv_escapeIdentifier() [1/2]
|
overrideprotectedvirtual |
This is overloaded version of drv_escapeIdentifier( const QString& str ) to be implemented in the same way.
Implements KDbDriver.
Definition at line 156 of file PostgresqlDriver.cpp.
◆ drv_escapeIdentifier() [2/2]
|
overrideprotectedvirtual |
Driver-specific SQL string escaping. This method is used by escapeIdentifier(). Implement escaping for any character like " or ' as your database engine requires. Do not append or prepend any quotation marks characters - it is automatically done by escapeIdentifier() using KDbDriverBehavior::OPENING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER and KDbDriverBehavior::CLOSING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER.
Implements KDbDriver.
Definition at line 151 of file PostgresqlDriver.cpp.
◆ drv_isSystemFieldName()
|
overrideprotectedvirtual |
- Returns
- true if name 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 KDbDriver.
Definition at line 118 of file PostgresqlDriver.cpp.
◆ escapeBLOB()
|
overridevirtual |
◆ escapeString() [1/2]
|
overridevirtual |
This is overloaded version of escapeString( const QString& str ) to be implemented in the same way.
Implements KDbDriver.
Definition at line 141 of file PostgresqlDriver.cpp.
◆ escapeString() [2/2]
|
overridevirtual |
Escape a string for use as a value.
Implements KDbDriver.
Definition at line 131 of file PostgresqlDriver.cpp.
◆ greatestOrLeastFunctionToString()
|
overridevirtual |
Generates native (driver-specific) GREATEST() and LEAST() function calls.
Since PostgreSQL's LEAST()/GREATEST() function ignores NULL values, it only returns NULL if all the expressions evaluate to NULL. So this is used for F(v0,..,vN): (CASE WHEN (v0) IS NULL OR .. OR (vN) IS NULL THEN NULL ELSE F(v0,..,vN) END) where F == GREATEST or LEAST.
Reimplemented from KDbDriver.
Definition at line 192 of file PostgresqlDriver.cpp.
◆ hexFunctionToString()
|
overridevirtual |
Generates native (driver-specific) HEX() function call.
Uses UPPER(ENCODE(val, 'hex')). See https://www.postgresql.org/docs/9.3/static/functions-string.html#FUNCTIONS-STRING-OTHER */
Reimplemented from KDbDriver.
Definition at line 166 of file PostgresqlDriver.cpp.
◆ ifnullFunctionToString()
|
overridevirtual |
Generates native (driver-specific) IFNULL() function call.
Uses COALESCE().
Reimplemented from KDbDriver.
Definition at line 174 of file PostgresqlDriver.cpp.
◆ isSystemDatabaseName()
|
overridevirtual |
- Returns
- true if name is a database type-specific system database's name, e.g. name of a built-in system database that cannot be created by a user, and in most cases user a name that user shouldn't even see.
Implements KDbDriver.
Definition at line 124 of file PostgresqlDriver.cpp.
◆ isSystemObjectName()
|
overridevirtual |
◆ lengthFunctionToString()
|
overridevirtual |
Generates native (driver-specific) LENGTH() function call.
For text types default LENGTH(val) is used, for BLOBs OCTET_LENGTH(val) is used because LENGTH(val) for BLOB returns number of bits.
Reimplemented from KDbDriver.
Definition at line 181 of file PostgresqlDriver.cpp.
◆ pgsqlToKDbType()
|
inline |
- Returns
- KDb field type for PostgreSQL type pqtype and modifier pqfmod. If type cannot be found KDbField::InvalidType is returned. Used in cursors to speed up data conversion.
Definition at line 96 of file PostgresqlDriver.h.
◆ pqfmodToLength()
|
inlinestatic |
Converts information converted from PQfmod() to length. -1 if missing.
< See e.g. postgis_get_char_length()
Definition at line 53 of file PostgresqlDriver.h.
◆ sqlTypeName()
|
overridevirtual |
Overrides the default implementation to allow for NUMERIC type natively.
Reimplemented from KDbDriver.
Definition at line 93 of file PostgresqlDriver.cpp.
◆ typeForSize()
|
inlinestatic |
Uses information obtained from PQfmod() and adjust type t if possible.
Also sets maxTextLength.
- Todo
using pqfmod not tested
more types such as decimal
Definition at line 68 of file PostgresqlDriver.h.
◆ unicodeFunctionToString()
|
overridevirtual |
Generates native (driver-specific) UNICODE() function call.
Uses ASCII(X).
Reimplemented from KDbDriver.
Definition at line 201 of file PostgresqlDriver.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.