This commit is contained in:
Sven Riwoldt
2024-10-19 12:31:37 +02:00
commit f7f8c52455
10176 changed files with 1619386 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt5.QtSql.
sip-version = "6.8.6"
sip-abi-version = "12.15"
module-tags = ["Qt_5_15_14", "WS_MACX"]
module-disabled-features = []

View File

@@ -0,0 +1,62 @@
// QtSqlmod.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%Module(name=PyQt5.QtSql, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Import QtWidgets/QtWidgetsmod.sip
%Copying
Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt5.
This file may be used under the terms of the GNU General Public License
version 3.0 as published by the Free Software Foundation and appearing in
the file LICENSE included in the packaging of this file. Please review the
following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you do not wish to use this file under the terms of the GPL version 3.0
then you may purchase a commercial license. For more information contact
info@riverbankcomputing.com.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%End
%DefaultSupertype sip.simplewrapper
%Include qsql.sip
%Include qsqldatabase.sip
%Include qsqldriver.sip
%Include qsqlerror.sip
%Include qsqlfield.sip
%Include qsqlindex.sip
%Include qsqlquery.sip
%Include qsqlquerymodel.sip
%Include qsqlrecord.sip
%Include qsqlrelationaldelegate.sip
%Include qsqlrelationaltablemodel.sip
%Include qsqlresult.sip
%Include qsqltablemodel.sip
%Include qtsqlglobal.sip

View File

@@ -0,0 +1,67 @@
// qsql.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (- Qt_5_8_0)
namespace QSql
{
%TypeHeaderCode
#include <qsql.h>
%End
enum Location
{
BeforeFirstRow,
AfterLastRow,
};
enum ParamTypeFlag
{
In,
Out,
InOut,
Binary,
};
typedef QFlags<QSql::ParamTypeFlag> ParamType;
enum TableType
{
Tables,
SystemTables,
Views,
AllTables,
};
enum NumericalPrecisionPolicy
{
LowPrecisionInt32,
LowPrecisionInt64,
LowPrecisionDouble,
HighPrecision,
};
};
%End
%If (- Qt_5_8_0)
QFlags<QSql::ParamTypeFlag> operator|(QSql::ParamTypeFlag f1, QFlags<QSql::ParamTypeFlag> f2);
%End

View File

@@ -0,0 +1,97 @@
// qsqldatabase.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlDriverCreatorBase /Supertype=sip.wrapper/
{
%TypeHeaderCode
#include <qsqldatabase.h>
%End
public:
virtual ~QSqlDriverCreatorBase();
virtual QSqlDriver *createObject() const = 0 /Factory/;
};
class QSqlDatabase
{
%TypeHeaderCode
#include <qsqldatabase.h>
%End
public:
QSqlDatabase();
QSqlDatabase(const QSqlDatabase &other);
~QSqlDatabase();
bool open() /ReleaseGIL/;
bool open(const QString &user, const QString &password) /ReleaseGIL/;
void close();
bool isOpen() const;
bool isOpenError() const;
QStringList tables(QSql::TableType type = QSql::Tables) const;
QSqlIndex primaryIndex(const QString &tablename) const;
QSqlRecord record(const QString &tablename) const;
QSqlQuery exec(const QString &query = QString()) const /PyName=exec_,ReleaseGIL/;
%If (Py_v3)
QSqlQuery exec(const QString &query = QString()) const /ReleaseGIL/;
%End
QSqlError lastError() const;
bool isValid() const;
bool transaction() /ReleaseGIL/;
bool commit() /ReleaseGIL/;
bool rollback() /ReleaseGIL/;
void setDatabaseName(const QString &name);
void setUserName(const QString &name);
void setPassword(const QString &password);
void setHostName(const QString &host);
void setPort(int p);
void setConnectOptions(const QString &options = QString());
QString databaseName() const;
QString userName() const;
QString password() const;
QString hostName() const;
QString driverName() const;
int port() const;
QString connectOptions() const;
QString connectionName() const;
QSqlDriver *driver() const;
static QSqlDatabase addDatabase(const QString &type, const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
static QSqlDatabase addDatabase(QSqlDriver *driver, const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
static QSqlDatabase cloneDatabase(const QSqlDatabase &other, const QString &connectionName);
%If (Qt_5_13_0 -)
static QSqlDatabase cloneDatabase(const QString &other, const QString &connectionName);
%End
static QSqlDatabase database(const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection), bool open = true);
static void removeDatabase(const QString &connectionName);
static bool contains(const QString &connectionName = QLatin1String(QSqlDatabase::defaultConnection));
static QStringList drivers();
static QStringList connectionNames();
static void registerSqlDriver(const QString &name, QSqlDriverCreatorBase *creator /Transfer/);
static bool isDriverAvailable(const QString &name);
protected:
explicit QSqlDatabase(const QString &type);
explicit QSqlDatabase(QSqlDriver *driver);
public:
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
};

View File

@@ -0,0 +1,160 @@
// qsqldriver.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlDriver : public QObject
{
%TypeHeaderCode
#include <qsqldriver.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QSqlQueryModel, &sipType_QSqlQueryModel, 3, 1},
{sipName_QSqlRelationalDelegate, &sipType_QSqlRelationalDelegate, -1, 2},
{sipName_QSqlDriver, &sipType_QSqlDriver, -1, -1},
{sipName_QSqlTableModel, &sipType_QSqlTableModel, 4, -1},
{sipName_QSqlRelationalTableModel, &sipType_QSqlRelationalTableModel, -1, -1},
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
public:
enum DriverFeature
{
Transactions,
QuerySize,
BLOB,
Unicode,
PreparedQueries,
NamedPlaceholders,
PositionalPlaceholders,
LastInsertId,
BatchOperations,
SimpleLocking,
LowPrecisionNumbers,
EventNotifications,
FinishQuery,
MultipleResultSets,
};
enum StatementType
{
WhereStatement,
SelectStatement,
UpdateStatement,
InsertStatement,
DeleteStatement,
};
enum IdentifierType
{
FieldName,
TableName,
};
explicit QSqlDriver(QObject *parent /TransferThis/ = 0);
virtual ~QSqlDriver();
virtual bool isOpen() const;
bool isOpenError() const;
virtual bool beginTransaction() /ReleaseGIL/;
virtual bool commitTransaction() /ReleaseGIL/;
virtual bool rollbackTransaction() /ReleaseGIL/;
virtual QStringList tables(QSql::TableType tableType) const;
virtual QSqlIndex primaryIndex(const QString &tableName) const;
virtual QSqlRecord record(const QString &tableName) const;
virtual QString formatValue(const QSqlField &field, bool trimStrings = false) const;
virtual QString escapeIdentifier(const QString &identifier, QSqlDriver::IdentifierType type) const;
virtual QString sqlStatement(QSqlDriver::StatementType type, const QString &tableName, const QSqlRecord &rec, bool preparedStatement) const;
QSqlError lastError() const;
virtual QVariant handle() const;
virtual bool hasFeature(QSqlDriver::DriverFeature f) const = 0;
virtual void close() = 0;
virtual QSqlResult *createResult() const = 0 /Factory/;
virtual bool open(const QString &db, const QString &user = QString(), const QString &password = QString(), const QString &host = QString(), int port = -1, const QString &options = QString()) = 0 /ReleaseGIL/;
protected:
virtual void setOpen(bool o);
virtual void setOpenError(bool e);
virtual void setLastError(const QSqlError &e);
public:
virtual bool subscribeToNotification(const QString &name);
virtual bool unsubscribeFromNotification(const QString &name);
virtual QStringList subscribedToNotifications() const;
enum NotificationSource
{
UnknownSource,
SelfSource,
OtherSource,
};
signals:
void notification(const QString &name);
void notification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload);
public:
virtual bool isIdentifierEscaped(const QString &identifier, QSqlDriver::IdentifierType type) const;
virtual QString stripDelimiters(const QString &identifier, QSqlDriver::IdentifierType type) const;
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
%If (Qt_5_4_0 -)
enum DbmsType
{
UnknownDbms,
MSSqlServer,
MySqlServer,
PostgreSQL,
Oracle,
Sybase,
SQLite,
Interbase,
DB2,
};
%End
%If (Qt_5_4_0 -)
QSqlDriver::DbmsType dbmsType() const;
%End
};

View File

@@ -0,0 +1,68 @@
// qsqlerror.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlError
{
%TypeHeaderCode
#include <qsqlerror.h>
%End
public:
enum ErrorType
{
NoError,
ConnectionError,
StatementError,
TransactionError,
UnknownError,
};
%If (Qt_5_3_0 -)
QSqlError(const QString &driverText = QString(), const QString &databaseText = QString(), QSqlError::ErrorType type = QSqlError::NoError, const QString &errorCode = QString());
%End
%If (Qt_5_3_0 -)
QSqlError(const QString &driverText, const QString &databaseText, QSqlError::ErrorType type, int number);
%End
%If (- Qt_5_3_0)
QSqlError(const QString &driverText = QString(), const QString &databaseText = QString(), QSqlError::ErrorType type = QSqlError::NoError, int number = -1);
%End
QSqlError(const QSqlError &other);
~QSqlError();
QString driverText() const;
void setDriverText(const QString &driverText);
QString databaseText() const;
void setDatabaseText(const QString &databaseText);
QSqlError::ErrorType type() const;
void setType(QSqlError::ErrorType type);
int number() const;
void setNumber(int number);
QString text() const;
bool isValid() const;
bool operator==(const QSqlError &other) const;
bool operator!=(const QSqlError &other) const;
%If (Qt_5_3_0 -)
QString nativeErrorCode() const;
%End
%If (Qt_5_10_0 -)
void swap(QSqlError &other /Constrained/);
%End
};

View File

@@ -0,0 +1,77 @@
// qsqlfield.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlField
{
%TypeHeaderCode
#include <qsqlfield.h>
%End
public:
enum RequiredStatus
{
Unknown,
Optional,
Required,
};
QSqlField(const QString &fieldName = QString(), QVariant::Type type = QVariant::Invalid);
%If (Qt_5_10_0 -)
QSqlField(const QString &fieldName, QVariant::Type type, const QString &tableName);
%End
QSqlField(const QSqlField &other);
bool operator==(const QSqlField &other) const;
bool operator!=(const QSqlField &other) const;
~QSqlField();
void setValue(const QVariant &value);
QVariant value() const;
void setName(const QString &name);
QString name() const;
bool isNull() const;
void setReadOnly(bool readOnly);
bool isReadOnly() const;
void clear();
QVariant::Type type() const;
bool isAutoValue() const;
void setType(QVariant::Type type);
void setRequiredStatus(QSqlField::RequiredStatus status);
void setRequired(bool required);
void setLength(int fieldLength);
void setPrecision(int precision);
void setDefaultValue(const QVariant &value);
void setSqlType(int type);
void setGenerated(bool gen);
void setAutoValue(bool autoVal);
QSqlField::RequiredStatus requiredStatus() const;
int length() const;
int precision() const;
QVariant defaultValue() const;
int typeID() const;
bool isGenerated() const;
bool isValid() const;
%If (Qt_5_10_0 -)
void setTableName(const QString &tableName);
%End
%If (Qt_5_10_0 -)
QString tableName() const;
%End
};

View File

@@ -0,0 +1,41 @@
// qsqlindex.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlIndex : public QSqlRecord
{
%TypeHeaderCode
#include <qsqlindex.h>
%End
public:
QSqlIndex(const QString &cursorName = QString(), const QString &name = QString());
QSqlIndex(const QSqlIndex &other);
~QSqlIndex();
void setCursorName(const QString &cursorName);
QString cursorName() const;
void setName(const QString &name);
QString name() const;
void append(const QSqlField &field);
void append(const QSqlField &field, bool desc);
bool isDescending(int i) const;
void setDescending(int i, bool desc);
};

View File

@@ -0,0 +1,88 @@
// qsqlquery.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlQuery
{
%TypeHeaderCode
#include <qsqlquery.h>
%End
public:
enum BatchExecutionMode
{
ValuesAsRows,
ValuesAsColumns,
};
explicit QSqlQuery(QSqlResult *r);
QSqlQuery(const QString &query = QString(), QSqlDatabase db = QSqlDatabase()) /ReleaseGIL/;
explicit QSqlQuery(QSqlDatabase db);
QSqlQuery(const QSqlQuery &other);
~QSqlQuery();
bool isValid() const;
bool isActive() const;
bool isNull(int field) const;
%If (Qt_5_3_0 -)
bool isNull(const QString &name) const;
%End
int at() const;
QString lastQuery() const;
int numRowsAffected() const;
QSqlError lastError() const;
bool isSelect() const;
int size() const;
const QSqlDriver *driver() const;
const QSqlResult *result() const;
bool isForwardOnly() const;
QSqlRecord record() const;
void setForwardOnly(bool forward);
bool exec(const QString &query) /PyName=exec_,ReleaseGIL/;
%If (Py_v3)
bool exec(const QString &query) /ReleaseGIL/;
%End
QVariant value(int i) const;
QVariant value(const QString &name) const;
bool seek(int index, bool relative = false) /ReleaseGIL/;
bool next() /ReleaseGIL/;
bool previous() /ReleaseGIL/;
bool first() /ReleaseGIL/;
bool last() /ReleaseGIL/;
void clear() /ReleaseGIL/;
bool exec() /PyName=exec_,ReleaseGIL/;
%If (Py_v3)
bool exec() /ReleaseGIL/;
%End
bool execBatch(QSqlQuery::BatchExecutionMode mode = QSqlQuery::ValuesAsRows);
bool prepare(const QString &query) /ReleaseGIL/;
void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type = QSql::In);
void bindValue(int pos, const QVariant &val, QSql::ParamType type = QSql::In);
void addBindValue(const QVariant &val, QSql::ParamType type = QSql::In);
QVariant boundValue(const QString &placeholder) const;
QVariant boundValue(int pos) const;
QMap<QString, QVariant> boundValues() const;
QString executedQuery() const;
QVariant lastInsertId() const;
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
void finish();
bool nextResult();
};

View File

@@ -0,0 +1,68 @@
// qsqlquerymodel.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlQueryModel : public QAbstractTableModel
{
%TypeHeaderCode
#include <qsqlquerymodel.h>
%End
public:
explicit QSqlQueryModel(QObject *parent /TransferThis/ = 0);
virtual ~QSqlQueryModel();
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
QSqlRecord record(int row) const;
QSqlRecord record() const;
virtual QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
void setQuery(const QSqlQuery &query);
void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase());
QSqlQuery query() const;
virtual void clear();
QSqlError lastError() const;
virtual void fetchMore(const QModelIndex &parent = QModelIndex());
virtual bool canFetchMore(const QModelIndex &parent = QModelIndex()) const;
protected:
virtual void queryChange();
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
void setLastError(const QSqlError &error);
void beginResetModel();
void endResetModel();
void beginInsertRows(const QModelIndex &parent, int first, int last);
void endInsertRows();
void beginRemoveRows(const QModelIndex &parent, int first, int last);
void endRemoveRows();
void beginInsertColumns(const QModelIndex &parent, int first, int last);
void endInsertColumns();
void beginRemoveColumns(const QModelIndex &parent, int first, int last);
void endRemoveColumns();
public:
%If (Qt_5_10_0 -)
virtual QHash<int, QByteArray> roleNames() const;
%End
};

View File

@@ -0,0 +1,63 @@
// qsqlrecord.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlRecord
{
%TypeHeaderCode
#include <qsqlrecord.h>
%End
public:
QSqlRecord();
QSqlRecord(const QSqlRecord &other);
~QSqlRecord();
bool operator==(const QSqlRecord &other) const;
bool operator!=(const QSqlRecord &other) const;
QVariant value(int i) const;
QVariant value(const QString &name) const;
void setValue(int i, const QVariant &val);
void setValue(const QString &name, const QVariant &val);
void setNull(int i);
void setNull(const QString &name);
bool isNull(int i) const;
bool isNull(const QString &name) const;
int indexOf(const QString &name) const;
QString fieldName(int i) const;
QSqlField field(int i) const;
QSqlField field(const QString &name) const;
bool isGenerated(int i) const;
bool isGenerated(const QString &name) const;
void setGenerated(const QString &name, bool generated);
void setGenerated(int i, bool generated);
void append(const QSqlField &field);
void replace(int pos, const QSqlField &field);
void insert(int pos, const QSqlField &field);
void remove(int pos);
bool isEmpty() const;
bool contains(const QString &name) const;
void clear();
void clearValues();
int count() const /__len__/;
%If (Qt_5_1_0 -)
QSqlRecord keyValues(const QSqlRecord &keyFields) const;
%End
};

View File

@@ -0,0 +1,37 @@
// qsqlrelationaldelegate.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlRelationalDelegate : public QItemDelegate
{
%TypeHeaderCode
#include <qsqlrelationaldelegate.h>
%End
public:
explicit QSqlRelationalDelegate(QObject *parent /TransferThis/ = 0);
virtual ~QSqlRelationalDelegate();
virtual QWidget *createEditor(QWidget *parent /TransferThis/, const QStyleOptionViewItem &option /NoCopy/, const QModelIndex &index) const /Factory/;
virtual void setModelData(QWidget *editor, QAbstractItemModel *model /KeepReference/, const QModelIndex &index) const;
%If (Qt_5_12_0 -)
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
%End
};

View File

@@ -0,0 +1,75 @@
// qsqlrelationaltablemodel.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlRelation
{
%TypeHeaderCode
#include <qsqlrelationaltablemodel.h>
%End
public:
QSqlRelation();
QSqlRelation(const QString &aTableName, const QString &indexCol, const QString &displayCol);
QString tableName() const;
QString indexColumn() const;
QString displayColumn() const;
bool isValid() const;
%If (Qt_5_8_0 -)
void swap(QSqlRelation &other /Constrained/);
%End
};
class QSqlRelationalTableModel : public QSqlTableModel
{
%TypeHeaderCode
#include <qsqlrelationaltablemodel.h>
%End
public:
QSqlRelationalTableModel(QObject *parent /TransferThis/ = 0, QSqlDatabase db = QSqlDatabase());
virtual ~QSqlRelationalTableModel();
virtual QVariant data(const QModelIndex &item, int role = Qt::ItemDataRole::DisplayRole) const;
virtual bool setData(const QModelIndex &item, const QVariant &value, int role = Qt::ItemDataRole::EditRole);
virtual void clear();
virtual bool select();
virtual void setTable(const QString &tableName);
virtual void setRelation(int column, const QSqlRelation &relation);
QSqlRelation relation(int column) const;
virtual QSqlTableModel *relationModel(int column) const;
virtual void revertRow(int row);
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
protected:
virtual QString selectStatement() const;
virtual bool updateRowInTable(int row, const QSqlRecord &values);
virtual QString orderByClause() const;
virtual bool insertRowIntoTable(const QSqlRecord &values);
public:
enum JoinMode
{
InnerJoin,
LeftJoin,
};
void setJoinMode(QSqlRelationalTableModel::JoinMode joinMode);
};

View File

@@ -0,0 +1,90 @@
// qsqlresult.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlResult /Supertype=sip.wrapper/
{
%TypeHeaderCode
#include <qsqlresult.h>
%End
public:
virtual ~QSqlResult();
virtual QVariant handle() const;
protected:
enum BindingSyntax
{
PositionalBinding,
NamedBinding,
};
explicit QSqlResult(const QSqlDriver *db);
int at() const;
QString lastQuery() const;
QSqlError lastError() const;
bool isValid() const;
bool isActive() const;
bool isSelect() const;
bool isForwardOnly() const;
const QSqlDriver *driver() const;
virtual void setAt(int at);
virtual void setActive(bool a);
virtual void setLastError(const QSqlError &e);
virtual void setQuery(const QString &query);
virtual void setSelect(bool s);
virtual void setForwardOnly(bool forward);
virtual bool exec() /PyName=exec_,ReleaseGIL/;
%If (Py_v3)
virtual bool exec() /ReleaseGIL/;
%End
virtual bool prepare(const QString &query) /ReleaseGIL/;
virtual bool savePrepare(const QString &sqlquery);
virtual void bindValue(int pos, const QVariant &val, QSql::ParamType type);
virtual void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type);
void addBindValue(const QVariant &val, QSql::ParamType type);
QVariant boundValue(const QString &placeholder) const;
QVariant boundValue(int pos) const;
QSql::ParamType bindValueType(const QString &placeholder) const;
QSql::ParamType bindValueType(int pos) const;
int boundValueCount() const;
QVector<QVariant> &boundValues() const;
QString executedQuery() const;
QString boundValueName(int pos) const;
void clear();
bool hasOutValues() const;
QSqlResult::BindingSyntax bindingSyntax() const;
virtual QVariant data(int i) = 0;
virtual bool isNull(int i) = 0;
virtual bool reset(const QString &sqlquery) = 0;
virtual bool fetch(int i) = 0 /ReleaseGIL/;
virtual bool fetchNext() /ReleaseGIL/;
virtual bool fetchPrevious() /ReleaseGIL/;
virtual bool fetchFirst() = 0 /ReleaseGIL/;
virtual bool fetchLast() = 0 /ReleaseGIL/;
virtual int size() = 0;
virtual int numRowsAffected() = 0;
virtual QSqlRecord record() const;
virtual QVariant lastInsertId() const;
private:
QSqlResult(const QSqlResult &);
};

View File

@@ -0,0 +1,97 @@
// qsqltablemodel.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QSqlTableModel : public QSqlQueryModel
{
%TypeHeaderCode
#include <qsqltablemodel.h>
%End
public:
enum EditStrategy
{
OnFieldChange,
OnRowChange,
OnManualSubmit,
};
QSqlTableModel(QObject *parent /TransferThis/ = 0, QSqlDatabase db = QSqlDatabase());
virtual ~QSqlTableModel();
virtual bool select();
virtual void setTable(const QString &tableName);
QString tableName() const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &idx, int role = Qt::ItemDataRole::DisplayRole) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::ItemDataRole::EditRole);
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::ItemDataRole::DisplayRole) const;
bool isDirty(const QModelIndex &index) const;
bool isDirty() const;
virtual void clear();
virtual void setEditStrategy(QSqlTableModel::EditStrategy strategy);
QSqlTableModel::EditStrategy editStrategy() const;
QSqlIndex primaryKey() const;
QSqlDatabase database() const;
int fieldIndex(const QString &fieldName) const;
virtual void sort(int column, Qt::SortOrder order);
virtual void setSort(int column, Qt::SortOrder order);
QString filter() const;
virtual void setFilter(const QString &filter);
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
bool insertRecord(int row, const QSqlRecord &record);
bool setRecord(int row, const QSqlRecord &record);
virtual void revertRow(int row);
public slots:
virtual bool submit();
virtual void revert();
bool submitAll();
void revertAll();
signals:
void primeInsert(int row, QSqlRecord &record);
void beforeInsert(QSqlRecord &record);
void beforeUpdate(int row, QSqlRecord &record);
void beforeDelete(int row);
protected:
virtual bool updateRowInTable(int row, const QSqlRecord &values);
virtual bool insertRowIntoTable(const QSqlRecord &values);
virtual bool deleteRowFromTable(int row);
virtual QString orderByClause() const;
virtual QString selectStatement() const;
void setPrimaryKey(const QSqlIndex &key);
void setQuery(const QSqlQuery &query);
virtual QModelIndex indexInQuery(const QModelIndex &item) const;
public:
virtual bool selectRow(int row);
QSqlRecord record() const;
QSqlRecord record(int row) const;
protected:
%If (Qt_5_1_0 -)
QSqlRecord primaryValues(int row) const;
%End
};

View File

@@ -0,0 +1,67 @@
// qtsqlglobal.sip generated by MetaSIP
//
// This file is part of the QtSql Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_8_0 -)
namespace QSql
{
%TypeHeaderCode
#include <qtsqlglobal.h>
%End
enum Location
{
BeforeFirstRow,
AfterLastRow,
};
enum ParamTypeFlag
{
In,
Out,
InOut,
Binary,
};
typedef QFlags<QSql::ParamTypeFlag> ParamType;
enum TableType
{
Tables,
SystemTables,
Views,
AllTables,
};
enum NumericalPrecisionPolicy
{
LowPrecisionInt32,
LowPrecisionInt64,
LowPrecisionDouble,
HighPrecision,
};
};
%End
%If (Qt_5_8_0 -)
QFlags<QSql::ParamTypeFlag> operator|(QSql::ParamTypeFlag f1, QFlags<QSql::ParamTypeFlag> f2);
%End