qsqlquery.sip 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // qsqlquery.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtSql Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QSqlQuery
  22. {
  23. %TypeHeaderCode
  24. #include <qsqlquery.h>
  25. %End
  26. public:
  27. enum BatchExecutionMode
  28. {
  29. ValuesAsRows,
  30. ValuesAsColumns,
  31. };
  32. explicit QSqlQuery(const QSqlDatabase &db);
  33. QSqlQuery(const QString &query = QString(), const QSqlDatabase &db = QSqlDatabase()) /ReleaseGIL/;
  34. explicit QSqlQuery(QSqlResult *r);
  35. QSqlQuery(const QSqlQuery &other);
  36. ~QSqlQuery();
  37. bool isValid() const;
  38. bool isActive() const;
  39. bool isNull(int field) const;
  40. %If (Qt_6_8_0 -)
  41. bool isNull(QAnyStringView name) const;
  42. %End
  43. %If (- Qt_6_8_0)
  44. bool isNull(const QString &name) const;
  45. %End
  46. int at() const;
  47. QString lastQuery() const;
  48. int numRowsAffected() const;
  49. QSqlError lastError() const;
  50. bool isSelect() const;
  51. int size() const;
  52. const QSqlDriver *driver() const;
  53. const QSqlResult *result() const;
  54. bool isForwardOnly() const;
  55. QSqlRecord record() const;
  56. void setForwardOnly(bool forward);
  57. bool exec(const QString &query) /ReleaseGIL/;
  58. QVariant value(int i) const;
  59. %If (Qt_6_8_0 -)
  60. QVariant value(QAnyStringView name) const;
  61. %End
  62. %If (- Qt_6_8_0)
  63. QVariant value(const QString &name) const;
  64. %End
  65. bool seek(int index, bool relative = false) /ReleaseGIL/;
  66. bool next() /ReleaseGIL/;
  67. bool previous() /ReleaseGIL/;
  68. bool first() /ReleaseGIL/;
  69. bool last() /ReleaseGIL/;
  70. void clear() /ReleaseGIL/;
  71. bool exec() /ReleaseGIL/;
  72. bool execBatch(QSqlQuery::BatchExecutionMode mode = QSqlQuery::ValuesAsRows);
  73. bool prepare(const QString &query) /ReleaseGIL/;
  74. void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type = QSql::In);
  75. void bindValue(int pos, const QVariant &val, QSql::ParamType type = QSql::In);
  76. void addBindValue(const QVariant &val, QSql::ParamType type = QSql::In);
  77. QVariant boundValue(const QString &placeholder) const;
  78. QVariant boundValue(int pos) const;
  79. QVariantList boundValues() const;
  80. QString executedQuery() const;
  81. QVariant lastInsertId() const;
  82. void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy);
  83. QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
  84. void finish();
  85. bool nextResult();
  86. %If (Qt_6_2_0 -)
  87. void swap(QSqlQuery &other /Constrained/);
  88. %End
  89. %If (Qt_6_6_0 -)
  90. QStringList boundValueNames() const;
  91. %End
  92. %If (Qt_6_6_0 -)
  93. QString boundValueName(int pos) const;
  94. %End
  95. %If (Qt_6_7_0 -)
  96. void setPositionalBindingEnabled(bool enable);
  97. %End
  98. %If (Qt_6_7_0 -)
  99. bool isPositionalBindingEnabled() const;
  100. %End
  101. };