summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QDate/Time: add toString(QStringView) overloadsMarc Mutz2017-04-121-2/+2
| | | | | | | | [ChangeLog][QtCore][QDate/QTime/QDateTime] Added toString() overloads taking the format as a QStringView. Change-Id: I322fa22e6b13fe8ba4badf0a3133425bd067ef32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SQLite: enable support for named placeholdersSamuel Gaist2017-04-041-2/+27
| | | | | | | | | | | | | | | | | SQLite has been supporting named placeholders for some time now and the code of the module is also written in that sense. The only thing that currently fails is the parameter count check. If the named placeholder is used several times then the parameter count will not match the value count. This patch adds a second check in that case. This use case is already tested by tst_qsqlquery. [ChangeLog][QtSql][SQLite] Named placeholder can now be used. If compiling Qt by hand and using system libraries, this feature requires at least SQLite 3.3.11. Change-Id: I1f6fa93f72bd809136894eafce0a2ae5cf6a62db Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* SQLite: Disable mutex on connectionsEric Lemanissier2017-03-251-0/+2
| | | | | | | | | | | | By default SQLite opens DB in Serialized mode, allowing connections to be used from several threads simultaneously: https://www.sqlite.org/threadsafe.html According to Qt documentation, database can only be used from one thread. This change opens sqlite dabases in "Multi-thread" mode, so that one does not pay for useless mutex locking for each DB access Change-Id: Ife61f1a648d74c91d3b27a2ce0059d052ccc62b2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Stop using sqlite3_enable_shared_cache: deprecated on macOSThiago Macieira2017-03-161-2/+1
| | | | | | | | | | | qsql_sqlite.cpp:643:5: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS 10.7 [-Wdeprecated-declarations] https://www.sqlite.org/c3ref/enable_shared_cache.html says to use the flag to sqlite3_open_v2() Change-Id: Ib499cebaa4c4489b90b9fffd149d3d5bf9434ae5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix possible use after free error in SQLite REGEXPLorenz Haas2017-03-021-6/+9
| | | | | | | | | If the cache insertion fails, regexp is deleted and "subject.contains(*regexp);" is UB. Coverity-Id: 176868 Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* REGEXP for SQLiteLorenz Haas2017-02-221-0/+63
| | | | | | | | | | | | | | | | | | | | | | Since SQLite does not define a regexp function by default, provide a Qt based implementation which can be enabled using QSQLITE_ENABLE_REGEXP as an connect option. This way statements like SELECT * FROM table WHERE col REGEXP '^[a-d]'; work out of the box. [ChangeLog][QtSql] Add QSQLITE_ENABLE_REGEXP connect option for QSQLiteDriver. If set a Qt based regexp() implementation is provided allowing to use REGEXP in SQL statements. Task-number: QTBUG-18084 Change-Id: I7f0e926fe4c5d6baea509f75497f46a61ca86679 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Sebastian Sauer <sebastian.sauer@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Plugins: optimize string usageAnton Kudryavtsev2016-10-181-1/+1
| | | | | | | | | | | | | Prefer QStringRef methods to avoid allocations. Use startsWith/endsWith rather than comparing substrings; and avoid substrings where references suffice. Use new QStringList::join(QL1S). Change-Id: I46c44aca96578633370006d613eb0ac13f7cfc03 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Adding notification feature to SQLite driverKarim Pinter2016-04-211-3/+78
| | | | | | | | | | | | This modification enables to use notification feature of SQLite with Qt SQL driver, enables to subscribe for notifications and also to remove notifications. close() is added to destructor to unregister notifications in case it is used in multiple threads. [ChangeLog][QtSql][SQLite] Adding notification feature to SQLite driver Change-Id: I8b98787f5214a406357646a98711a8ff6045a0dd Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Always compile sql drivers as pluginsLars Knoll2016-04-071-0/+828
Compiling the drivers into Qt Sql does not make a lot of sense anymore, as we handle plugins well enough in the build system these days. [ChangeLog][Build system] SQL drivers are now always compiled as plugins. Change-Id: I364b82a480849399d1fafe4b20e9f08922569260 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>