summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlquery.h
Commit message (Collapse)AuthorAgeFilesLines
* QSqlQuery: complete the deprecation/removal of its copiesGiuseppe D'Angelo2025-02-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlQuery has been made movable in Qt 6.2 (14f9f00fdb2dc428610c08e3d9d03e38e9602166). The pre-existing copy operations have been deprecated, but not removed, in order to preserve SC/BC. This left us with two issues: 1) Whether or not to keep the deprecated copies in Qt 7. The answer is no: the copy operations are impossible to implement in a way consistent with value semantics (the state of the DB driver can't be copied in general). Therefore, mark the related APIs as to-be-removed, and not just deprecated. 2) While we no longer copy QSqlQuery from Qt code directly, QMetaType still detects the presence of the copy constructor and extracts it, triggering the deprecation warning. Rather than unconditionally suppressing the warning (which will hide any similar issue we might have in the future), add a local workaround that raises a runtime warning if QSqlQuery is copied through QMetaType, while not raising the deprecation warning when building Qt itself. [ChangeLog][QtSql][QSqlQuery] Copying a QSqlQuery object via QMetaType now raises a runtime warning. Note that copy operations for QSqlQuery objects have already been deprecated since Qt 6.2, and are planned to be removed in Qt 7. Fixes: QTBUG-132752 Task-number: QTBUG-91766 Pick-to: 6.9 Change-Id: I48714ad53ec706a5e4e055c45a1c05f372382940 Reviewed-by: Marc Mutz <[email protected]>
* SQL: Code cleanup - move Q_PROPERTY to the correct placeChristian Ehrlicher2024-06-121-1/+1
| | | | | | | | ... which is directly after Q_OBJECT/Q_GADGET Pick-to: 6.8 Change-Id: I3fb2b2e810a68e0ae811e55b286bc5f40364295f Reviewed-by: Volker Hilsheimer <[email protected]>
* QSqlRecord/QSqlQuery: Use QAnyStringView instead QStringViewChristian Ehrlicher2024-06-041-2/+6
| | | | | | | | | | | | | | | | Change all functions taking a QStringView to take a QAnyStringView and remove all functions taking a const QStringRef since this can now be fully handled by the QAnyStringView ones. This amends f2dba1919427bcc0f510d7f60e3fafbd6f41430d and 993f31801446c1d851c7c8d54c9b55216acd0993 [ChangeLog][QtSql][QSqlRecord] All functions taking a QString were changed to take a QAnyStringView. Pick-to: 6.8 Change-Id: Ia1c968c4e2a7a93aa26d090ef6605271305c14a6 Reviewed-by: Volker Hilsheimer <[email protected]>
* QSqlQuery: add Q_PROPERTYChristian Ehrlicher2024-01-241-0/+6
| | | | | | | | | Add Q_PROPERTY to follow the current Qt style and simplify the documentation. Task-number: QTBUG-120566 Change-Id: I3803f5246c1814d627a16fa2569d1342b54f6adf Reviewed-by: Kai Köhne <[email protected]>
* SQL: rename enablePositionalBinding() to setPositionalBindingEnabled()Christian Ehrlicher2024-01-101-2/+2
| | | | | | | | | | | | | | | ... and the getter to isPositionalBindingEnabled() for QSqlQuery and QSqlResult. This amends e532933a2a9ff0219f0179880e05c95e0ec5e19d [ChangeLog][QtSql][QSqlQuery] Add setPositionalBindingEnabled() to be able to disable positional binding. Pick-to: 6.7 Task-number: QTBUG-119952 Fixes: QTBUG-120548 Change-Id: I0a0afb652d0fc9421f5692b0927a66b2a9b7b854 Reviewed-by: Friedemann Kleint <[email protected]>
* QSqlQuery: Add QStringView overloadsChristian Ehrlicher2024-01-101-1/+3
| | | | | | | | | | | | Add an overload to QSqlQuery::isNull()/::value() taking a QStringView - those two functions can now use the newly introduced QSqlRecord::indexOf(QStringView) [ChangeLog][QtSql][QSqlRecord] QSqlQuery::isNull() and value() gained a new overload taking a QStringView. Change-Id: Icebce88b94a7413130bdd7ec0098f51726d05892 Reviewed-by: Andy Shaw <[email protected]>
* SQL/PSQL: Handle jsonb operators in prepared queriesChristian Ehrlicher2023-07-231-0/+3
| | | | | | | | | | | | Add an option to disable handling of positional binding so jsonb operators are not screwed up [ChangeLog][QtSql][QSqlQuery] Add setEnablePositionalBinding() to be able to disable positional binding. Fixes: QTBUG-96636 Change-Id: I428a9d3b10274b97292ab86a74d9b3971d6f10e9 Reviewed-by: Andy Shaw <[email protected]>
* QSqlQuery: add boundValueName()/boundValueNames()Christian Ehrlicher2023-04-071-0/+2
| | | | | | | | | | [ChangeLog][SQL][SqlQuery] Added two new functions boundValueName()/boundValueNames() to return the names of the bound values. Fixes: QTBUG-97847 Change-Id: I8df5f15e8df13141a34d38b0a2e13b37f4e7829c Reviewed-by: Volker Hilsheimer <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Rest of QtBase: compile-optimize inline swap functionsMarc Mutz2022-03-171-3/+1
| | | | | | | | | | | | | | | | Instead of using the overly-generic qSwap() monster, use - qt_ptr_swap() for swapping raw pointers - member-swap for swapping smart pointers and owning containers In QtCore, this has proven to give a nice reduction in compile time for Qt users, cf. b1b0c2970e480ef460a61f37fa430dc443390358. Pick-to: 6.3 6.2 Task-number: QTBUG-97601 Change-Id: I53e031a021031d53a74a712cd0f5e6bb8bf800bd Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* QSqlQuery: make it a move only typeGiuseppe D'Angelo2021-03-211-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSqlQuery is a broken value class. Copying one object would mean copying database state (the result set, the cursor position, etc.) which isn't generally available for all database drivers. For that reason, the current implementation does not honor value semantics -- modifying a QSqlQuery object has visible side effects on its existing copies (!). The correct solution is to accept that QSqlQuery is a move only type, not a value type. Add move semantics to it, and deprecate its copies. (We can't just *remove* copies in Qt 6 due to SC/BC constraints). [ChangeLog][QtSql][QSqlQuery] QSqlQuery copy operations have been deprecated. QSqlQuery copy semantics cannot be implemented correctly, as it's not generally possible to copy a result set of a query when copying the corresponding QSqlQuery object. This resulted in modifications on a QSqlQuery having visible (and unintended) side effects on its copies. Instead, treat QSqlQuery as a move-only type. Fixes: QTBUG-91766 Change-Id: Iabd3aa605332a5c15c524303418bf17a21ed520b Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Andy Shaw <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Change boundValues() to return a QVariantListAndy Shaw2020-06-221-3/+3
| | | | | | | | | | | | | This enables the order of boundValues to be consistent as with a QMap it could have been reordered which can be a problem for positional bindings. [ChangeLog][QtSQL] Changed signature of QSqlQuery::boundValues() to return a QVariantList Fixes: QTBUG-51609 Change-Id: I1c80fa8522fa7352723420b6fc9ec466406315fb Reviewed-by: Volker Hilsheimer <[email protected]>
* pass QSqlDatabase by const &Albert Astals Cid2019-10-151-2/+2
| | | | | Change-Id: I326c09ab9313098470cb657571f67755fd7810c7 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add qtsqlglobal.h and qtsqlglobal_p.hLars Knoll2016-07-031-1/+1
| | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. QtSql already had such a header, but its name (qsql.h) was not in line with what's being used in all other modules. So add a qtsqlglobal.h header, deprecate qsql.h and turn it into a a forwarding header to that new global header file. Change-Id: Ibaeb95b008cf08ba062cbfe8a3f4d3bf79294390 Reviewed-by: Oswald Buddenhagen <[email protected]>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <[email protected]>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <[email protected]>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <[email protected]>
* QSqlQuery::isNull string overloadTasuku Suzuki2013-12-011-0/+1
| | | | | | | | | | Introduce isNull overload to take field name as a parameter. This is corresponding to the commit 7e6e1412348fb8d8df844d821ee80d6d3de69517 Change-Id: I122f79707d26eaa09c2f38dc31aeee1dac7de33b Reviewed-by: Mark Brand <[email protected]>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <[email protected]> Reviewed-by: Jędrzej Nowacki <[email protected]> Reviewed-by: hjk <[email protected]>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <[email protected]>
* QSqlQuery::value string overloadThiago A. Correa2012-10-081-0/+1
| | | | | | | | | | Introduce value overload to take field name as a parameter. This allows for terser application code that avoids explicit calls to QSqlRecord::value(). Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b Reviewed-by: Mark Brand <[email protected]>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Sergio Ahumada <[email protected]>
* QtSql: make some constructors explicitMarc Mutz2012-03-121-2/+2
| | | | | | | | | | This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I3a79f66f9705bc991175f396138efe3088727a85 Reviewed-by: Mark Brand <[email protected]> Reviewed-by: Honglei Zhang <[email protected]>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <[email protected]>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <[email protected]>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <[email protected]>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <[email protected]>
* Remove QT3_SUPPORT from qsql, qxmlGabriel de Dietrich2011-07-061-3/+0
| | | | | | | Change-Id: Iab36ef60de2f0201efa4eb86d8ed5e514d6244fb Reviewed-on: http://codereview.qt.nokia.com/1188 Reviewed-by: Qt Sanity Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+130
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12