summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqldatabase.h
Commit message (Collapse)AuthorAgeFilesLines
* Add security tags to the Qt Sql moduleVolker Hilsheimer2025-09-171-0/+1
| | | | | | | | | | | | | | Tag code that constructs SQL statements, parses results, or deals with user credentials as security critical. This is the driver code, the implementation of QSqlResult, QSqlTableModel, and the QSqlDatabase implementation (which deals with, and optionally stores, credentials). The rest of the code is not critical and gets the default tag. Fixes: QTBUG-135591 Pick-to: 6.10 6.9 6.8 Change-Id: I18fb565fd27ed8d1c9c1f3a1f572816b718eb3e8 Reviewed-by: Mate Barany <mate.barany@qt.io>
* QSqlDatabase: provide QString defaultConnectionName()Thiago Macieira2025-02-071-7/+12
| | | | | | | | This avoids doing a conversion from 8-bit to UTF-16 and thus allocating memory on the call to these functions. Change-Id: Ibed5fc9ef19a21ea475efffdb978f45c1b9b3cc0 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QSqlDatabase: fix historical mistake of defaultConnection being non-constThiago Macieira2025-02-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | This was likely never intended, and was a mistake in the API design, missing the second const after the pointer. It should have been: static const char *const defaultConnection; This commit fixes that mistake by replacing the variable with a constexpr one that can't be modified. We can actually do better by moving the name to the header, so it will get emitted in each library, application, or plugin instead of trying to load from QtSql. [ChangeLog][Potentially Source-Incompatible Changes] The static QSqlDatabase::connectionName member variable has changed from a non-const pointer to a constexpr array. Modifying the pointer was most likely a mistake in code and would produce a misbehaving application. Change-Id: Icf2eddc865c2d6dde0c7fffda06e55e215e5f26d Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* SQL: Code cleanup - move Q_PROPERTY to the correct placeChristian Ehrlicher2024-06-121-1/+2
| | | | | | | | ... which is directly after Q_OBJECT/Q_GADGET Pick-to: 6.8 Change-Id: I3fb2b2e810a68e0ae811e55b286bc5f40364295f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSqlDatabase: Rename currentThread() to thread()Christian Ehrlicher2024-05-311-1/+1
| | | | | | | | ... to be in sync with QObject naming. This amends b4c63b89dfe136d0579bf1b6422c4d878cdd74ab. Change-Id: I25301f65aa880205d8c0cfd6f4bfa9fdba34a01c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add -Wweak-vtables to headerscleanJesus Fernandez2024-05-191-1/+1
| | | | | | | | | | | | | | | | | | | This requires some fixes in several classes that are also included in this patch. The QTestEvent hierarchy is all-inline and changes layout depending on QT_GUI_LIB and QT_WIDGETS_LIB, so we can't just export it. Suppress the warning in that header for now. Created QTBUG-104486 to track a fix for the real issue. The QFutureInterface hierarchy is also all-inline, but templates, so doesn't trigger, except the <void> specialization. Created QTBUG-125115 to track a fix for the real issue. Done-with: Marc Mutz <marc.mutz@qt.io> Task-number: QTBUG-45582 Change-Id: I96b3e109aa989b70e0d4809b90bd53a369e50d55 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSqlDatabase: add moveToThread()/currentThread()Christian Ehrlicher2024-04-251-0/+3
| | | | | | | | | | | | | Add QSqlDatabase::moveToThread() to be able to move the driver instance to another thread. [ChangeLog][Sql][QSqLDatabase] QSqlDatabase gained two new functions moveToThread() and currentThread() to be able to use it in another thread than the one it was created in. Fixes: QTBUG-39957 Change-Id: I9cb51358f73a3a2fa72813bfdbe059279d388bd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSqlDatabase: add Q_PROPERTYChristian Ehrlicher2024-02-051-0/+5
| | | | | | | | | Add Q_PROPERTY to follow the current Qt style and simplify the documentation. Task-number: QTBUG-120566 Change-Id: I23103a921cd391f24ce0ffd915a4ae2f98686d21 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* QtSql: Stylistic fixes based on the Qt 6.6 api reviewChristian Ehrlicher2023-07-081-1/+1
| | | | | | | | Amends 12909d7c3df74b88382b727cfd3e215914f291ba and 0efd8854c4b32ec0b011efbf6b3a1990fe684e32. Pick-to: 6.6 Change-Id: Id7cb7377bcd1f32092330d2fc5b2fa5b83ce941f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSqlDatabase: deprecate QSqlDatabase::exec()Christian Ehrlicher2023-03-061-0/+3
| | | | | | | | The note that QSqlDatabase::exec() is deprecated was added more than 12 years ago so it's time to also mark the function as such. Change-Id: Ic5e7c31b3ff5b21e16e2640548cba1a4baaeeb1c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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 <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Sql: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-191-4/+4
| | | | | | Task-number: QTBUG-98434 Change-Id: Ia621f9d937649dda41a7b0d13a61e6f1397f6dde Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add overload of QSqlDatabase::cloneDatabase to allow cloning cross threadsAndy Shaw2018-12-231-0/+1
| | | | | | | | | | | Since QSqlDatabase::database() cannot be used to access another database from another thread, then the overload is provided to make it possible to clone with just the connection name. This will handle the cloning internally safely then. Fixes: QTBUG-72545 Change-Id: I861cc5aa2c38c1e3797f6f086594a1228f05bada Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtSql: Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-041-6/+1
| | | | | | | | Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: I1d0f89784f8fb698828e11ce39086501971f1756 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* 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 <oswald.buddenhagen@theqtcompany.com>
* 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 <lars.knoll@theqtcompany.com>
* 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 <matti.paaso@theqtcompany.com>
* Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-1/+1
| | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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 <iikka.eklund@digia.com>
* Remove the use of QT_STATIC_CONST in QtSqlThiago Macieira2014-06-201-1/+6
| | | | | | | | | | | | | | | | | | | | There doesn't seem to be any reason why the macro is actually necessary. My guess is that someone wrote the code on Windows without "const", then it failed to compile everywhere else. Instead of fixing the code by adding the "const", the developer must have added this macro. Microsoft Visual Studio mangles the constness of the variable, so we can't remove it now from existing compilers. But we can for the new version. This is also required to compile QtSql with the MSVC option /Zc:strictStrings, which is enabled in Qt 5.4. Change-Id: Ibf2c2cb7287a4332d69aa81080a37aab4327677d Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* 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 <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* 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 <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* 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 <rohan.mcgovern@nokia.com>
* 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 <lars.knoll@nokia.com>
* 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 <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QT3_SUPPORT from qsql, qxmlGabriel de Dietrich2011-07-061-9/+0
| | | | | | | Change-Id: Iab36ef60de2f0201efa4eb86d8ed5e514d6244fb Reviewed-on: http://codereview.qt.nokia.com/1188 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* 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/+161
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