aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/sqlite
Commit message (Collapse)AuthorAgeFilesLines
* QmlDesigner: Remove template parameter from project storageMarco Bubke9 days1-2/+12
| | | | | | | | | | | | | There are now other ways to prevent locking bugs. So we don't need the template parameter anymore. That makes it possible to move much of the code to a cpp file. Maybe later we have to move some functions back for performance reasons. Change-Id: I01269912618d7cf5e070219e7edaa3a00623b7cf Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Integrate item library entries from project storageMarco Bubke9 days1-7/+31
| | | | | | | Task-number: QDS-12102 Change-Id: Id6fbfcfb44d3b8c290f5e5d74addf33ef4d9a5e5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Sqlite: Prevent name collisions for indicesMarco Bubke2024-04-091-0/+19
| | | | | | | | | There can be unique and not unique indices with the same columns. So we add that attribute to the name to distinguish between the indices. Change-Id: I96eac1f0e95c135d625f09fd5399b16f2293d645 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Sqlite: Fix prepare tracingMarco Bubke2024-03-251-2/+2
| | | | | | | Change-Id: I2b0c36789886d0924ac8130a4d46f3c13fc7518b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* QmlDesigner: Add more tracing to project storageMarco Bubke2024-03-202-6/+33
| | | | | | | Change-Id: Iee113981ffa49b4f03b7641e7030a2f19f917fc6 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Sqlite: trace exceptionsMarco Bubke2024-03-207-54/+103
| | | | | | | | | That makes it easier to see what got wrong in the trace. So less debugging. Change-Id: I26ec3d6a6f81cbd20871260a2b32123343a20618 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Improve tracingMarco Bubke2024-03-202-53/+217
| | | | | | Change-Id: Id5d6ee448a7f2cf06cda2e2776f3dbbe7c8f66c4 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Nanotrace: Fix dangling referenceMarco Bubke2024-03-181-4/+4
| | | | | | | | | | | As EventQueueData was derived from EventQueue the order of initialization was inverted. So we got dangling pointer. Merging EventQueueData into EventQueue fixes the dangling references. Change-Id: I3d9cee492304132fa612d6d19324656df597ec99 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Sqlite: Add convertToString to Sqlite idMarco Bubke2024-03-182-1/+9
| | | | | | | Change-Id: I52d9b6860d24d715fdd6b584ffc2f8345f6b99c4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Nanotrace: Optimize queueMarco Bubke2024-02-281-3/+2
| | | | | | | | | | Instead that the queue data is generating a queue it is now derived from it. That saves one thread local entry. Change-Id: Iba4f3002019fc281457c6108ae955a2f755bb9f6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Merge remote-tracking branch 'origin/12.0' into qds/devTim Jenssen2023-12-131-0/+1
|\ | | | | | | Change-Id: I0a598ba1b4d57be361a7a203d0c39e99b5cd5fba
| * Sqlite: Fix missing include file in dev packageEike Ziller2023-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | sqliteexception.h:6:10: fatal error: sqlite3_fwd.h: No such file or directory Amends eed303450d96471f258254d71eee070f2c8caf4b Change-Id: I350246e223bd80129b1fb29e8b2b57953536b5c7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* | Merge remote-tracking branch 'origin/12.0' into qds/devTim Jenssen2023-11-011-1/+5
|\| | | | | | | Change-Id: Iefea658312bba6675eadce23fb8dc92f9207ea0e
| * Sqlite: Disable before Qt6.4.3Christian Stenger2023-09-201-1/+4
| | | | | | | | | | | | | | | | Does not build before Qt6.4 and cmake build only builds it from Qt6.4.3 onwards. Change-Id: Ie3ffa37eb1c164b4fd151e2cf73918cfd4740175 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * qbs build: Improve some base itemsChristian Kandeler2023-09-181-0/+1
| | | | | | | | | | | | | | | | Clean-up, simplification and modernization. Also fix the bugs uncovered by this. Change-Id: Ia3a77557f10faf9a901540a55fd6c07a2e986bf5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Nanotrace: Add flowsMarco Bubke2023-10-191-25/+32
| | | | | | | | | | | | | | Change-Id: If9c6642449a495f2fcc94f843b7fcd7bf2ab4548 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | Nanotrace: Remove the magic booleans and use an enumerationMarco Bubke2023-10-172-10/+11
| | | | | | | | | | | | | | Hopefully it will make more clear what is disabled or enabled. Change-Id: Ibc9b2329f5b664ba346bafeb27c54cf082758449 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Nanotrace: Change event queue allocationMarco Bubke2023-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | The event queue data will be not filled with zero if it has internal linkage. Change-Id: Icb7798ac7ad8cc4c4f486b49e9d94f08625b818a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* | Nanotrace: Add asynchronous trace pointsMarco Bubke2023-10-131-2/+2
| | | | | | | | | | | | | | With asynchronous traces you can follow complex tasks. Change-Id: Ia0fd20f34f3529c59eff5d222c8d87ac5dacd514 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | QmlDesigner: Fix typoMarco Bubke2023-10-131-1/+1
| | | | | | | | | | | | | | Change-Id: I95d015bde565995d3c5429e0dbb94782e2dd0981 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | QmlDesigner: Fix thread local tracing categoriesMarco Bubke2023-10-133-17/+22
| | | | | | | | | | | | | | | | | | | | The macro was not exported to the category was not enabled in other targets for inline functions. Change-Id: I176df1bc6aaaf8b3c8851224e78e43238a98a3a8 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | NanoTrace: Reduce macros with template specializationMarco Bubke2023-10-122-13/+16
| | | | | | | | | | | | | | | | | | The nano trace code gets more complicated but the usage get mor readable. Change-Id: I2b829455d1328dc330474abbb804c76232df3e92 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* | Sqlite: Use nanotracerMarco Bubke2023-10-123-5/+102
| | | | | | | | | | | | | | Change-Id: I32ff23b4115eaeda998810082b044f2b320c5124 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | QmlDesigner: Move item library entries to project storageMarco Bubke2023-10-115-3/+67
|/ | | | | | | | | | | | | The subcomponent manager is synchronizing some meta files with the item library. The project storage is synchronizing types. Synchronizing both is quite complicated. Moving the the functionality to the project storage removes that synchronization task. Task-number: QDS-10266 Change-Id: Icdf14fbe85d5c4891542acae85ebecf0ba77b45d Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlDesigner: Add std::hash to NodeMetaInfoMarco Bubke2023-09-071-1/+1
| | | | | | Change-Id: Ib4c9bb3e275167e846629845d16773c03386b39b Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Add hash operator to BasicIdMarco Bubke2023-09-061-0/+11
| | | | | | | | | Because QHash is supporting std::hash we don't need to add a qHash function. That is saving us an include to qhashfunction.h too. Change-Id: I457051c828d25771028f3f28bf19ecb65c51edd1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Sqlite: Introduce implicit transactionMarco Bubke2023-09-062-5/+35
| | | | | | | | | | | | | | Sqlite adds an implicit transaction if no transaction is used. That can be problematic if you use multiple statements but it is okay for one read statement. Write and read write statements should use immediate transactions because the acquire the write lock. Otherwise the write lock is only acquired as you try to write. From there it is much harder to recover. Change-Id: I04b0be7447f2b82b6921738d789c33cbbaa8de6e Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* QmlDesigner: Hopefully fix strange MSVC failMarco Bubke2023-09-061-1/+1
| | | | | | Change-Id: I9677a85269a7496d557e7e3e9127604e48f668a4 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* Revert "Sqlite: Flatten calls inside functions"Tim Jenssen2023-08-293-28/+24
| | | | | | | | | This reverts commit 2a301d41c41afb1e1fceda0b1a22fa507c668366. Reason for revert: msvc uses a different syntax Change-Id: Iec4ae2a65e6957c6e1368cc481a63fab0e55ce9e Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Sqlite: Improve insertUpdateDeleteMarco Bubke2023-08-291-9/+9
| | | | | | | | | | Instead of a value we keep the iterator. That is saving us a useless copy because the value range cannot change. Change-Id: I2ea36b5a08e378f8e148f317c3384e4c4954a439 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Sqlite: Reset is noexceptMarco Bubke2023-08-291-1/+1
| | | | | | | Change-Id: I4d702619e17118681a46dbc904038031a6f98353 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Make simple getter inlineMarco Bubke2023-08-292-6/+1
| | | | | | Change-Id: I8bba89a45f32a6491ca3bfef4535b5183c98382a Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Disable locking test for releaseMarco Bubke2023-08-291-0/+2
| | | | | | Change-Id: I7a54241bdddb23f9b0b3bddbf10844d9eff36cc4 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Flatten calls inside functionsMarco Bubke2023-08-283-24/+28
| | | | | | | | | The code is doing quite some template magic. This helps the compiler to be persistent in removing intermediate function calls. So it would look like handwritten code. Change-Id: Idbe152b9256f5ea23d5a4c42ea2cfd117346d3a7 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Sqlite: Extent Statement::values for other containerMarco Bubke2023-08-284-13/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | You can now use QList and QVarLenghtArray for values. The later is quite interesting because it is not allocating for a provided capacity. So you can now write: statement.valuesWithTransaction<QVarLenghtArray<int, 1024>>(); And in almost all case no expensive memory is allocated. With the help of NRVO there should be no copy too. That is very useful for temporary values which are transformed into a different type. The capacity changed to an template parameter too: statement.valuesWithTransaction<int, 1024>(); That is more clear than before: statement.valuesWithTransaction<int>(1024); Change-Id: I6d8d10ed9db0cc37f0579353a416e36e23c30415 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: More test for NodeMetaInfoMarco Bubke2023-07-121-2/+0
| | | | | | Task-number: QDS-10055 Change-Id: I23a9d7ea87dff9f3e07f5beeb734cea7d01d2e94 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Sqlite: Don't link to the internal Sqlite libraryMarco Bubke2023-06-281-9/+21
| | | | | | | | | If you link to the internal Sqlite library you link actually twice. That leads to strange bugs because you have an uninitialized object file. The static linking workaround is now moved to cmake. Change-Id: I51d966a623a18486ce5870d898999f3ce139f092 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Merge remote-tracking branch 'origin/11.0' into qds/devTim Jenssen2023-06-022-5/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp tests/auto/qml/qmlprojectmanager/fileformat/fileformat.qbs tests/auto/qml/qmlprojectmanager/fileformat/tst_fileformat.cpp Change-Id: I257f1908917bcc58805619b53b6866f2f73ca544
| * Sqlite: Fix compilation with QTC_STATIC_BUILDCristian Adam2023-05-251-4/+1
| | | | | | | | | | Change-Id: Ie94439d190245e821c17de73075397695d1af413 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * Merge remote-tracking branch 'origin/qds/dev'Tim Jenssen2023-05-227-73/+82
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: coin/instructions/build.yaml doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl src/libs/CMakeLists.txt src/libs/advanceddockingsystem/dockmanager.cpp src/libs/advanceddockingsystem/workspacedialog.cpp src/plugins/coreplugin/manhattanstyle.cpp src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmldesigner/components/formeditor/toolbox.cpp src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp src/plugins/qmldesigner/components/toolbar/toolbarbackend.cpp src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp src/plugins/qmldesignerbase/qmldesignerbaseplugin.cpp src/plugins/qmldesignerbase/qmldesignerbaseplugin.h src/plugins/qmlprojectmanager/qmlproject.cpp src/tools/qml2puppet/CMakeLists.txt tests/unit/unittest/CMakeLists.txt Change-Id: I2c5f18c4fca49471d02713ce5859032232cf7756
| * | CMake: Add -fPIC also for OBJECT librariesCristian Adam2023-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add_qtc_library would have set the POSITION_INDEPENDENT_CODE property for STATIC libraries on UNIX based systems. The OBJECT libraries need the same treatment. Change-Id: Ia333a36ea0f35d7db3ed876cdde5b895b47644c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | | Sqlite: Make statement moveableMarco Bubke2023-05-301-0/+2
| | | | | | | | | | | | | | | | | | | | | It is save to move a sqlite statement. Change-Id: I094e4221ed1d14f01bf202cff6840518efb52cb0 Reviewed-by: Aleksei German <aleksei.german@qt.io>
* | | Sqlite: Fix that prepare is not checking that the database is lockedMarco Bubke2023-05-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The database has to be locked because otherwise it is not thread save. Because Sqlite connections are already called in different threads this has to be enforced. The easiest way to lock a database is to put it in a transaction. It should be ok without locking so long the connection is only called from one thread but I prefer to enforce it because I have already seen code was preparing a statement not on initialization stage where it is highly unlikely that there is more than one thread pre connection but in the middle of the code. Because preparing is much more expensive than a lock I prefer to enfore a lock here. Change-Id: Id0b47f8d615a6697bb807392cafbe976bdd37233 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | | Sqlite: Improve readCallbackMarco Bubke2023-05-301-2/+16
| |/ |/| | | | | | | | | | | | | | | There are many callback which do not control the flow and want to be called for all steps. For that case we assume that a callback without a return value will continue always. Change-Id: I706123f2c425ac8c937d4d60ab977dae5ea9b030 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
* | Sqlite: Improve transaction by inversion of controlMarco Bubke2023-05-223-68/+77
| | | | | | | | | | | | | | | | | | | | Using a callable makes it possible to omit the commit call. It is now called by the withDeferredTransaction and withImmediateTransaction function. Change-Id: I9b7bfa7e32f269fe8fcba2fe5e1218e73f5846d1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
* | QmlDesigner: Improve warning suppressionMarco Bubke2023-05-101-7/+0
| | | | | | | | | | | | | | Can be removed with never compiler. Change-Id: I3196acfc82e3ab53f0f72dec3b543f27b9bbe2e1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | QmlDesigner: Improve sqlite idMarco Bubke2023-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://www.sqlite.org/autoinc.html says that "If no negative ROWID values are inserted explicitly, then automatically generated ROWID values will always be greater than zero." So zero is an invalid value. This changes reflect on it and makes it an invalid value too. Null is a special value in SQL and it could cast to zero by accident. To prevent that ambiguty we make zero an invalid value too. You can explicit add negative rowids but that has size overhead because positive values can be compressed. So explicit not positive values are not supported. Change-Id: I417ea9fec1573cfd9f1a98134f8adc567021988c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | QmlDesigner: fix unterminated access to data()Tim Jenssen2023-05-081-1/+1
| | | | | | | | | | | | | | SmallString is not null terminated. Change-Id: I92346f1befce8afadcf0d5532c17906a7908fff2 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | QmlDesigner: Disbable maybe-uninitialized warningMarco Bubke2023-04-191-0/+7
| | | | | | | | | | | | | | Change-Id: I683bacc47b6f98a7adb64c3391c3df65c42fe945 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | QmlDesigner: Let ~LibraryInitializer() throw exceptionMarco Bubke2023-04-172-2/+2
|/ | | | | | | | | Because LibraryInitializer has no state it should be fine if it is used like intended. The exception is anyway fatal. Change-Id: I397e5b03e63d69f1468b46a8f333522629f1d882 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>