While ORM can be disabled, Orm::Utils has been split into Orm::Utils
and Orm::Tiny::Utils (Orm::Tiny::TinyUtils alias).
So when ORM is disabled then utils used only in the ORM will be
excluded from a final build.
- bugfix cmake undefined ORM option in TinySources
Added TINYORM_DISABLE_ORM macro controlled by ORM for CMake and
disable_orm for qmake. When TINYORM_DISABLE_ORM macro is defined then
only the query builder without ORM is compiled.
Also excludes ORM-related unit tests.
Overrides default detection logic for thread_local and disable it
forcefully.
In qmake can be configured by "CONFIG+=disable_thread_local".
For Cmake DISABLE_THREAD_LOCAL option was added.
- initial g++/clang build, ctest on MSYS2 UCRT64 on Windows Server 2022
- initial cmake build/ctest on Ubuntu 20.40
- initial cmake build/ctest on MSVC on Windows Server 2019
changed driver to QPSQL in tst_databasemanager
This avoids crash when QMYSQL driver's dll is unavailable.
QMYSQL driver is not shipped by default by Qt Windows MSVC installer.
Database connections in threads is supported on:
- Linux gcc all linkers
- MinGW clang lld linker only
- MSVC (is king anyway 😎)
All other variants cause different compiler errors or runtime crashes.
Database connection can run in a thread, if you create a connection in
a thread, then you have to use it only from that thread, moving it to
another thread is disallowed.
All restrictions for QSqlDatabase are true also for TinyORM.
The most important work was in DatabaseManager because more threads can
access it at once.
DatabaseManager has to be created only once in the whole application,
so it means when it will be created in a non-main thread, then it has
to be used from this non-main thread the whole time, I didn't try it
to move to another thread, the conclusion is that DatabaseManager can be
created and used from a worker thread.
- refactored db configuration
- added DatabaseConnectionsMap to outsource ConnectionsType and make it
thread_local
- added resetDefaultConnection()
- m_queryLogId is atomic
- made all class static data members thread_local
Thread unrelated:
- added two new addConnections() overloads
- added Thread utils class
- added NameThreadForDebugging()
- enhanced tst_DatabaseManager