Added practically everything I wanted to have in except for updating
columns.
Needed to name the schema namespace as Orm::SchemaNs to avoid collision
with the Orm::Schema class.
- unit tests with great coverage
- new schema constants
- a new prefix_indexes and engine DB conncetion configurations
Others:
- IsModel tag
- enhanced columnize in the BaseGrammar
- used a new columnize logic in all grammars
- new constants
- new container utils class for joining containers
- new DB::driver() getter for QSqlDriver
- avoid possible crash in tests with pretend, added empty log checks
- clang tidy, excluded to word from short variable names
Transactions extracted to the Concerns::ManagesTransactions base class.
- bugfix includes
- logConnected()/logDisconnected() code wrapped in TINYORM_MYSQL_PING
- hitTransactionalCounters() extracted to Concerns::CountsQueries
- convertNamedToPositionalBindings() extracted to Concerns::LogsQueries
Queries counters extracted to the Concerns::CountsQueries base class.
- removed ConnectionInterface 😕😎🙌
- all methods are returning DatabaseConnection & instead of
ConnectionInterface
- includes cleanup after extraction
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.
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
Added CONFIG option inline_constants/extern_constants, in shared library
build is used extern_constants option ( can be overridden by
inline_constants option ) and in static library build is used
inline_constants option ( can not be overridden, extern constants cause
crash ).
- refactored exports in TinyUtils
- bugfix on tst_version for static build
Discarded configuration of the version header file by version.hpp.in,
instead the project version is obtained from version.hpp file.
- also added autotest to test these versions
- like cherries on a cake, a real Product/FileVersion in exe/dll of the
TinyOrm.dll and utils.dll is tested too 😲😎
- added new Fs library class to the utils dll
- renamed macro defines in utils project to TINYUTILS_XYZ_HPP
- support for querying nested relations existence/absence
- added tests for all possible overloads 😲, 28 unit tests and 14
functional tests
- added has() related proxies to the Model and Relation
- added documentation
- gcc and clang specific fixes
others:
- used clazy exclude comments instead of suppressing warnings in IDE
groupBy() methods now take column expressions.
- added all proxies
- added new perfectly forwarded groupBy(&&...args) overload
- all new code tested manually in the TinyOrmPlayground
- also all tests pass, problem was only with bool values and truncate
statement ( can't be send as prepared statement )
- updated migration and seeds, added PostgreSQL connection
- bugfix in migration script ?? vs ?:
- added DatabaseConnection::unprepared()
- added query log
- added pretending (dry run) feature
- pretending has separate logging logic for qDebug()
- added records have been modified flag to the database connection
- deleted copy/move ctors for connection classes
The HasOne and BelongsTo can now return default model instead
of the nullptr.
- also added tests
- added documentation
- updated test db structure, null foreign key in previewable files
- to the test db into the previewable files added row without parent
- relation factory methods return actual creating type instead of
the general base Relation type
- added u_fillable on models used in tests that need it
- added documentation for mass assignment
- added tests for mass assignment feature
- added new Torrent models for tests, which have set up u_fillable and
u_guarded differently
- added schema grammar, query post-processor, and schema builder, they
was needed for database column listing during a mass assignment
guarded attributes check, used to check if the given attribute is
a valid guardable column
- fixed mysql query builder unit tests
- every query builder unit tests will have own test project, sqlite
test project will be in the next commit to preserve commit history