Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtSql.QSqlDriver Class Referenceabstract

The QSqlDriver class is an abstract base class for accessing specific SQL databases. More...

Inheritance diagram for QtSql.QSqlDriver:
Collaboration diagram for QtSql.QSqlDriver:

Public Types

enum  DriverFeature {
  BLOB = 2, BatchOperations = 8, EventNotifications = 11, FinishQuery = 12,
  LastInsertId = 7, LowPrecisionNumbers = 10, MultipleResultSets = 13, NamedPlaceholders = 5,
  PositionalPlaceholders = 6, PreparedQueries = 4, QuerySize = 1, SimpleLocking = 9,
  Transactions = 0, Unicode = 3
}
  More...
 
enum  IdentifierType { FieldName = 0, TableName = 1 }
  More...
 
enum  StatementType {
  DeleteStatement = 4, InsertStatement = 3, SelectStatement = 1, UpdateStatement = 2,
  WhereStatement = 0
}
  More...
 

Public Member Functions

 QSqlDriver (QObject parent=null)
 
 
override void CreateProxy ()
 
virtual bool BeginTransaction ()
 
 
abstract void Close ()
 
 
virtual bool CommitTransaction ()
 
 
abstract QSqlResult CreateResult ()
 
 
virtual string EscapeIdentifier (string identifier, QSqlDriver.IdentifierType type)
 
 
virtual string FormatValue (QSqlField field, bool trimStrings=false)
 
 
virtual object Handle ()
 
 
abstract bool HasFeature (QSqlDriver.DriverFeature f)
 
 
new bool IsIdentifierEscaped (string identifier, QSqlDriver.IdentifierType type)
 
 
virtual bool IsOpen ()
 
 
new bool IsOpenError ()
 
 
new QSqlError LastError ()
 
 
abstract bool Open (string db, string user="", string password="", string host="", int port=-1, string connOpts="")
 
 
virtual QSqlIndex PrimaryIndex (string tableName)
 
 
virtual QSqlRecord Record (string tableName)
 
 
virtual bool RollbackTransaction ()
 
 
virtual string SqlStatement (QSqlDriver.StatementType type, string tableName, QSqlRecord rec, bool preparedStatement)
 
 
new string StripDelimiters (string identifier, QSqlDriver.IdentifierType type)
 
 
new bool SubscribeToNotification (string name)
 
 
new
System.Collections.Generic.List
< string > 
SubscribedToNotifications ()
 
 
virtual
System.Collections.Generic.List
< string > 
Tables (QSql.TableType tableType)
 
 
new bool UnsubscribeFromNotification (string name)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool OnEvent (QEvent arg1)
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QSqlDriver (System.Type dummy)
 
new bool IsIdentifierEscapedImplementation (string identifier, QSqlDriver.IdentifierType type)
 
 
new void OnNotification (string name)
 
 
virtual void SetLastError (QSqlError e)
 
 
virtual void SetOpen (bool o)
 
 
virtual void SetOpenError (bool e)
 
 
new string StripDelimitersImplementation (string identifier, QSqlDriver.IdentifierType type)
 
 
new bool SubscribeToNotificationImplementation (string name)
 
 
new
System.Collections.Generic.List
< string > 
SubscribedToNotificationsImplementation ()
 
 
new bool UnsubscribeFromNotificationImplementation (string name)
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

Slot< System.String > Notification
 
 
new QSql.NumericalPrecisionPolicy NumericalPrecisionPolicy [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQSqlDriverSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QSqlDriver class is an abstract base class for accessing specific SQL databases.

This class should not be used directly. Use QSqlDatabase instead.

If you want to create your own SQL drivers, you can subclass this class and reimplement its pure virtual functions and those virtual functions that you need. See How to Write Your Own Database Driver for more information.

See also QSqlDatabase and QSqlResult.

Member Enumeration Documentation

This enum contains a list of features a driver might support. Use hasFeature() to query whether a feature is supported or not.

More information about supported features can be found in the Qt SQL driver documentation.

See also hasFeature().

Enumerator:
BLOB 

Whether the driver supports Binary Large Object fields.

BatchOperations 

Whether the driver supports batched operations, see QSqlQuery::execBatch()

EventNotifications 

Whether the driver supports database event notifications.

FinishQuery 

Whether the driver can do any low-level resource cleanup when QSqlQuery::finish() is called.

LastInsertId 

Whether the driver supports returning the Id of the last touched row.

LowPrecisionNumbers 

Whether the driver allows fetching numerical values with low precision.

MultipleResultSets 

Whether the driver can access multiple result sets returned from batched statements or stored procedures.

NamedPlaceholders 

Whether the driver supports the use of named placeholders.

PositionalPlaceholders 

Whether the driver supports the use of positional placeholders.

PreparedQueries 

Whether the driver supports prepared query execution.

QuerySize 

Whether the database is capable of reporting the size of a query. Note that some databases do not support returning the size (i.e. number of rows returned) of a query, in which case QSqlQuery::size() will return -1.

SimpleLocking 

Whether the driver disallows a write lock on a table while other queries have a read lock on it.

Transactions 

Whether the driver supports SQL transactions.

Unicode 

Whether the driver supports Unicode strings if the database server does.

This enum contains a list of SQL identifier types.

Enumerator:
FieldName 

A SQL field name

TableName 

A SQL table name

This enum contains a list of SQL statement (or clause) types the driver can create.

See also sqlStatement().

Enumerator:
DeleteStatement 

An SQL DELETE statement (e.g., DELETE FROM t).

InsertStatement 

An SQL INSERT statement (e.g., INSERT INTO t (f) values (1)).

SelectStatement 

An SQL SELECT statement (e.g., SELECT f FROM t).

UpdateStatement 

An SQL UPDATE statement (e.g., UPDATE TABLE t set f = 1).

WhereStatement 

An SQL WHERE statement (e.g., WHERE f = 5).

Constructor & Destructor Documentation

QtSql.QSqlDriver.QSqlDriver ( System.Type  dummy)
protected
QtSql.QSqlDriver.QSqlDriver ( QObject  parent = null)

Constructs a new driver with the given parent.

Member Function Documentation

virtual bool QtSql.QSqlDriver.BeginTransaction ( )
virtual

This function is called to begin a transaction. If successful, return true, otherwise return false. The default implementation does nothing and returns false.

See also commitTransaction() and rollbackTransaction().

abstract void QtSql.QSqlDriver.Close ( )
pure virtual

Derived classes must reimplement this pure virtual function in order to close the database connection. Return true on success, false on failure.

See also open() and setOpen().

virtual bool QtSql.QSqlDriver.CommitTransaction ( )
virtual

This function is called to commit a transaction. If successful, return true, otherwise return false. The default implementation does nothing and returns false.

See also beginTransaction() and rollbackTransaction().

override void QtSql.QSqlDriver.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

abstract QSqlResult QtSql.QSqlDriver.CreateResult ( )
pure virtual

Creates an empty SQL result on the database. Derived classes must reimplement this function and return a QSqlResult object appropriate for their database to the caller.

new void QtSql.QSqlDriver.Dispose ( )
virtual string QtSql.QSqlDriver.EscapeIdentifier ( string  identifier,
QSqlDriver.IdentifierType  type 
)
virtual

Returns the identifier escaped according to the database rules. identifier can either be a table name or field name, dependent on type.

The default implementation does nothing.

See also isIdentifierEscaped().

virtual string QtSql.QSqlDriver.FormatValue ( QSqlField  field,
bool  trimStrings = false 
)
virtual

Returns a string representation of the field value for the database. This is used, for example, when constructing INSERT and UPDATE statements.

The default implementation returns the value formatted as a string according to the following rules:

If field is character data, the value is returned enclosed in single quotation marks, which is appropriate for many SQL databases. Any embedded single-quote characters are escaped (replaced with two single-quote characters). If trimStrings is true (the default is false), all trailing whitespace is trimmed from the field.

If field is date/time data, the value is formatted in ISO format and enclosed in single quotation marks. If the date/time data is invalid, "NULL" is returned.

If field is bytearray data, and the driver can edit binary fields, the value is formatted as a hexadecimal string.

For any other field type, toString() is called on its value and the result of this is returned.

See also QVariant::toString().

virtual object QtSql.QSqlDriver.Handle ( )
virtual

Returns the low-level database handle wrapped in a QVariant or an invalid variant if there is no handle.

Warning: Use this with uttermost care and only if you know what you're doing.

Warning: The handle returned here can become a stale pointer if the connection is modified (for example, if you close the connection).

Warning: The handle can be NULL if the connection is not open yet.

The handle returned here is database-dependent, you should query the type name of the variant before accessing it.

This example retrieves the handle for a connection to sqlite:

QSqlDatabase db = ...;

QVariant v = db.driver()->handle();

if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {

// v.data() returns a pointer to the handle

sqlite3 handle = *static_cast<sqlite3 **>(v.data());

if (handle != 0) { // check that it is not NULL

...

}

}

This snippet returns the handle for PostgreSQL or MySQL:

if (qstrcmp(v.typeName(), "PGconn") == 0) {

PGconn handle = *static_cast<PGconn **>(v.data());

if (handle != 0) ...

}

if (qstrcmp(v.typeName(), "MYSQL") == 0) {

MYSQL *handle = *static_cast<MYSQL **>(v.data());

if (handle != 0) ...

}

See also QSqlResult::handle().

abstract bool QtSql.QSqlDriver.HasFeature ( QSqlDriver.DriverFeature  f)
pure virtual

Returns true if the driver supports feature feature; otherwise returns false.

Note that some databases need to be open() before this can be determined.

See also DriverFeature.

new bool QtSql.QSqlDriver.IsIdentifierEscaped ( string  identifier,
QSqlDriver.IdentifierType  type 
)

Returns whether identifier is escaped according to the database rules. identifier can either be a table name or field name, dependent on type.

Warning: Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in your QSqlDriver subclass, reimplement the isIdentifierEscapedImplementation() slot in your subclass instead. The isIdentifierEscapedFunction() will dynamically detect the slot and call it.

See also stripDelimiters() and escapeIdentifier().

new bool QtSql.QSqlDriver.IsIdentifierEscapedImplementation ( string  identifier,
QSqlDriver.IdentifierType  type 
)
protected

This slot returns whether identifier is escaped according to the database rules. identifier can either be a table name or field name, dependent on type.

Because of binary compatibility constraints, isIdentifierEscaped() function (introduced in Qt 4.5) is not virtual. Instead, isIdentifierEscaped() will dynamically detect and call this slot. The default implementation assumes the escape/delimiter character is a double quote. Reimplement this slot in your own QSqlDriver if your database engine uses a different delimiter character.

This function was introduced in Qt 4.6.

See also isIdentifierEscaped().

virtual bool QtSql.QSqlDriver.IsOpen ( )
virtual

Returns true if the database connection is open; otherwise returns false.

new bool QtSql.QSqlDriver.IsOpenError ( )

Returns true if the there was an error opening the database connection; otherwise returns false.

new QSqlError QtSql.QSqlDriver.LastError ( )

Returns a QSqlError object which contains information about the last error that occurred on the database.

See also setLastError().

new void QtSql.QSqlDriver.OnNotification ( string  name)
protected

This signal is emitted when the database posts an event notification that the driver subscribes to. name identifies the event notification.

This function was introduced in Qt 4.4.

See also subscribeToNotification().

abstract bool QtSql.QSqlDriver.Open ( string  db,
string  user = "",
string  password = "",
string  host = "",
int  port = -1,
string  connOpts = "" 
)
pure virtual

Derived classes must reimplement this pure virtual function to open a database connection on database db, using user name user, password password, host host, port port and connection options options.

The function must return true on success and false on failure.

See also setOpen().

virtual QSqlIndex QtSql.QSqlDriver.PrimaryIndex ( string  tableName)
virtual

Returns the primary index for table tableName. Returns an empty QSqlIndex if the table doesn't have a primary index. The default implementation returns an empty index.

virtual QSqlRecord QtSql.QSqlDriver.Record ( string  tableName)
virtual

Returns a QSqlRecord populated with the names of the fields in table tableName. If no such table exists, an empty record is returned. The default implementation returns an empty record.

virtual bool QtSql.QSqlDriver.RollbackTransaction ( )
virtual

This function is called to rollback a transaction. If successful, return true, otherwise return false. The default implementation does nothing and returns false.

See also beginTransaction() and commitTransaction().

virtual void QtSql.QSqlDriver.SetLastError ( QSqlError  e)
protectedvirtual

This function is used to set the value of the last error, error, that occurred on the database.

See also lastError().

virtual void QtSql.QSqlDriver.SetOpen ( bool  o)
protectedvirtual

This function sets the open state of the database to open. Derived classes can use this function to report the status of open().

See also open() and setOpenError().

virtual void QtSql.QSqlDriver.SetOpenError ( bool  e)
protectedvirtual

This function sets the open error state of the database to error. Derived classes can use this function to report the status of open(). Note that if error is true the open state of the database is set to closed (i.e., isOpen() returns false).

See also isOpenError(), open(), and setOpen().

virtual string QtSql.QSqlDriver.SqlStatement ( QSqlDriver.StatementType  type,
string  tableName,
QSqlRecord  rec,
bool  preparedStatement 
)
virtual

Returns a SQL statement of type type for the table tableName with the values from rec. If preparedStatement is true, the string will contain placeholders instead of values.

This method can be used to manipulate tables without having to worry about database-dependent SQL dialects. For non-prepared statements, the values will be properly escaped.

new string QtSql.QSqlDriver.StripDelimiters ( string  identifier,
QSqlDriver.IdentifierType  type 
)

Returns the identifier with the leading and trailing delimiters removed, identifier can either be a table name or field name, dependent on type. If identifier does not have leading and trailing delimiter characters, identifier is returned without modification.

Warning: Because of binary compatibility constraints, this function is not virtual, If you want to provide your own implementation in your QSqlDriver subclass, reimplement the stripDelimitersImplementation() slot in your subclass instead. The stripDelimiters() function will dynamically detect the slot and call it.

This function was introduced in Qt 4.5.

See also isIdentifierEscaped().

new string QtSql.QSqlDriver.StripDelimitersImplementation ( string  identifier,
QSqlDriver.IdentifierType  type 
)
protected

This slot returns identifier with the leading and trailing delimiters removed, identifier can either be a tablename or field name, dependent on type. If identifier does not have leading and trailing delimiter characters, identifier is returned without modification.

Because of binary compatibility constraints, the stripDelimiters() function (introduced in Qt 4.5) is not virtual. Instead, stripDelimiters() will dynamically detect and call this slot. It generally unnecessary to reimplement this slot.

This function was introduced in Qt 4.6.

See also stripDelimiters().

new System.Collections.Generic.List<string> QtSql.QSqlDriver.SubscribedToNotifications ( )

Returns a list of the names of the event notifications that are currently subscribed to.

Warning: Because of binary compatibility constraints, this function is not virtual. If you want to provide event notification support in your own QSqlDriver subclass, reimplement the subscribedToNotificationsImplementation() slot in your subclass instead. The subscribedToNotifications() function will dynamically detect the slot and call it.

This function was introduced in Qt 4.4.

See also subscribeToNotification() and unsubscribeFromNotification().

new System.Collections.Generic.List<string> QtSql.QSqlDriver.SubscribedToNotificationsImplementation ( )
protected

Returns a list of the names of the event notifications that are currently subscribed to.

Reimplement this slot to provide your own QSqlDriver subclass with event notification support; because of binary compatibility constraints, the subscribedToNotifications() function (introduced in Qt 4.4) is not virtual. Instead, subscribedToNotifications() will dynamically detect and call this slot. The default implementation simply returns an empty QStringList.

This function was introduced in Qt 4.4.

See also subscribedToNotifications().

new bool QtSql.QSqlDriver.SubscribeToNotification ( string  name)

This function is called to subscribe to event notifications from the database. name identifies the event notification.

If successful, return true, otherwise return false.

The database must be open when this function is called. When the database is closed by calling close() all subscribed event notifications are automatically unsubscribed. Note that calling open() on an already open database may implicitly cause close() to be called, which will cause the driver to unsubscribe from all event notifications.

When an event notification identified by name is posted by the database the notification() signal is emitted.

Warning: Because of binary compatibility constraints, this function is not virtual. If you want to provide event notification support in your own QSqlDriver subclass, reimplement the subscribeToNotificationImplementation() slot in your subclass instead. The subscribeToNotification() function will dynamically detect the slot and call it.

This function was introduced in Qt 4.4.

See also unsubscribeFromNotification(), subscribedToNotifications(), and QSqlDriver::hasFeature().

new bool QtSql.QSqlDriver.SubscribeToNotificationImplementation ( string  name)
protected

This slot is called to subscribe to event notifications from the database. name identifies the event notification.

If successful, return true, otherwise return false.

The database must be open when this slot is called. When the database is closed by calling close() all subscribed event notifications are automatically unsubscribed. Note that calling open() on an already open database may implicitly cause close() to be called, which will cause the driver to unsubscribe from all event notifications.

When an event notification identified by name is posted by the database the notification() signal is emitted.

Reimplement this slot to provide your own QSqlDriver subclass with event notification support; because of binary compatibility constraints, the subscribeToNotification() function (introduced in Qt 4.4) is not virtual. Instead, subscribeToNotification() will dynamically detect and call this slot. The default implementation does nothing and returns false.

This function was introduced in Qt 4.4.

See also subscribeToNotification().

virtual System.Collections.Generic.List<string> QtSql.QSqlDriver.Tables ( QSql.TableType  tableType)
virtual

Returns a list of the names of the tables in the database. The default implementation returns an empty list.

The tableType argument describes what types of tables should be returned. Due to binary compatibility, the string contains the value of the enum QSql::TableTypes as text. An empty string should be treated as QSql::Tables for backward compatibility.

static string QtSql.QSqlDriver.Tr ( string  s,
string  c = null 
)
static
static string QtSql.QSqlDriver.Tr ( string  s,
string  c,
int  n 
)
static
static string QtSql.QSqlDriver.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtSql.QSqlDriver.TrUtf8 ( string  s,
string  c,
int  n 
)
static
new bool QtSql.QSqlDriver.UnsubscribeFromNotification ( string  name)

This function is called to unsubscribe from event notifications from the database. name identifies the event notification.

If successful, return true, otherwise return false.

The database must be open when this function is called. All subscribed event notifications are automatically unsubscribed from when the close() function is called.

After calling this function the notification() signal will no longer be emitted when an event notification identified by name is posted by the database.

Warning: Because of binary compatibility constraints, this function is not virtual. If you want to provide event notification support in your own QSqlDriver subclass, reimplement the unsubscribeFromNotificationImplementation() slot in your subclass instead. The unsubscribeFromNotification() function will dynamically detect the slot and call it.

This function was introduced in Qt 4.4.

See also subscribeToNotification() and subscribedToNotifications().

new bool QtSql.QSqlDriver.UnsubscribeFromNotificationImplementation ( string  name)
protected

This slot is called to unsubscribe from event notifications from the database. name identifies the event notification.

If successful, return true, otherwise return false.

The database must be open when this slot is called. All subscribed event notifications are automatically unsubscribed from when the close() function is called.

After calling this slot the notification() signal will no longer be emitted when an event notification identified by name is posted by the database.

Reimplement this slot to provide your own QSqlDriver subclass with event notification support; because of binary compatibility constraints, the unsubscribeFromNotification() function (introduced in Qt 4.4) is not virtual. Instead, unsubscribeFromNotification() will dynamically detect and call this slot. The default implementation does nothing and returns false.

This function was introduced in Qt 4.4.

See also unsubscribeFromNotification().

Property Documentation

new IQSqlDriverSignals QtSql.QSqlDriver.Emit
getprotected
Slot<System.String> QtSql.QSqlDriver.Notification
addremove

This signal is emitted when the database posts an event notification that the driver subscribes to. name identifies the event notification.

This function was introduced in Qt 4.4.

See also subscribeToNotification().

new QSql.NumericalPrecisionPolicy QtSql.QSqlDriver.NumericalPrecisionPolicy
getset

Returns the current default precision policy for the database connection.

This function was introduced in Qt 4.6.

Sets the default numerical precision policy used by queries created by this driver to precisionPolicy.

Note: Setting the default precision policy to precisionPolicy doesn't affect any currently active queries.

This function was introduced in Qt 4.6.

new QMetaObject QtSql.QSqlDriver.StaticMetaObject
staticget