1// qsqlquery.sip generated by MetaSIP 2// 3// This file is part of the QtSql Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QSqlQuery 24{ 25%TypeHeaderCode 26#include <qsqlquery.h> 27%End 28 29public: 30 enum BatchExecutionMode 31 { 32 ValuesAsRows, 33 ValuesAsColumns, 34 }; 35 36 explicit QSqlQuery(QSqlResult *r); 37 QSqlQuery(const QString &query = QString(), QSqlDatabase db = QSqlDatabase()) /ReleaseGIL/; 38 explicit QSqlQuery(QSqlDatabase db); 39 QSqlQuery(const QSqlQuery &other); 40 ~QSqlQuery(); 41 bool isValid() const; 42 bool isActive() const; 43 bool isNull(int field) const; 44%If (Qt_5_3_0 -) 45 bool isNull(const QString &name) const; 46%End 47 int at() const; 48 QString lastQuery() const; 49 int numRowsAffected() const; 50 QSqlError lastError() const; 51 bool isSelect() const; 52 int size() const; 53 const QSqlDriver *driver() const; 54 const QSqlResult *result() const; 55 bool isForwardOnly() const; 56 QSqlRecord record() const; 57 void setForwardOnly(bool forward); 58 bool exec(const QString &query) /PyName=exec_,ReleaseGIL/; 59%If (Py_v3) 60 bool exec(const QString &query) /ReleaseGIL/; 61%End 62 QVariant value(int i) const; 63 QVariant value(const QString &name) const; 64 bool seek(int index, bool relative = false) /ReleaseGIL/; 65 bool next() /ReleaseGIL/; 66 bool previous() /ReleaseGIL/; 67 bool first() /ReleaseGIL/; 68 bool last() /ReleaseGIL/; 69 void clear() /ReleaseGIL/; 70 bool exec() /PyName=exec_,ReleaseGIL/; 71%If (Py_v3) 72 bool exec() /ReleaseGIL/; 73%End 74 bool execBatch(QSqlQuery::BatchExecutionMode mode = QSqlQuery::ValuesAsRows); 75 bool prepare(const QString &query) /ReleaseGIL/; 76 void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type = QSql::In); 77 void bindValue(int pos, const QVariant &val, QSql::ParamType type = QSql::In); 78 void addBindValue(const QVariant &val, QSql::ParamType type = QSql::In); 79 QVariant boundValue(const QString &placeholder) const; 80 QVariant boundValue(int pos) const; 81 QMap<QString, QVariant> boundValues() const; 82 QString executedQuery() const; 83 QVariant lastInsertId() const; 84 void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy); 85 QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const; 86 void finish(); 87 bool nextResult(); 88}; 89