Commit Graph

686 Commits

Author SHA1 Message Date
silverqx 4c9bf9c7e9 added note constant 2023-05-05 14:14:15 +02:00
silverqx 1c538527ef tests fixed clang warning 2023-05-05 13:56:22 +02:00
silverqx 4808d90121 tests formatting 2023-05-05 13:52:25 +02:00
silverqx 7f344a2145 added ModelsCollection 🔥🚀🎉
The Orm::Tiny::Types::ModelsCollection is container class with
additional handy methods like pluck(), whereIn(), filter(), ...
It extends the QVector. The template parameter can be the Model or
Model *, the model must be the Derived model type eg. Torrent, Post, ...

All ORM-related methods return the ModelsCollection so it can be easily
filtered, changed, transformed with one simple line or callback.
All the algorithms are nicely encapsulated in the ModelsCollection
methods.

Currently, there is this pattern, all TinyBuilder or Model methods are
returning the ModelsCollection<Derived> and all relation related
methods are returning the ModelsCollection<Derived *>.

 - added Album and AlbumImage migrations and seeder data (also PHP)
 - added Album and AlbumImage models
 - added functional tests for ModelsCollection<Model> and
   ModelsCollection<Model *>
 - all ModelsCollection methods or algorithms are unit tested
 - replaced all occurences of the QVector<Model> and QVector<Model *>
   with the ModelsCollection<Model> and ModelsCollection<Model *> 😵‍💫
 - tests added Model::findMany()
 - added reserve() on few places
 - removed useless #include-s
2023-05-05 13:06:15 +02:00
silverqx 226442d6f3 bugfix php seeder 2023-05-04 08:52:00 +02:00
silverqx 7525051a78 bugfix php seeder 2023-05-04 08:36:45 +02:00
silverqx f9fc6ca080 tests formatting 2023-05-03 17:30:57 +02:00
silverqx 1470ef8fbb tests bugfix missing reference 2023-05-03 17:30:10 +02:00
silverqx 954e4f42f4 tests updated timestamp 2023-04-30 14:00:18 +02:00
silverqx 8673113cd7 tests used QVERIFY() instead of Q_ASSERT() 2023-04-04 15:58:19 +02:00
silverqx dc7c41e3a2 tests bugfix Q_ASSERT() in Release build 2023-04-04 15:57:54 +02:00
silverqx 1e75726881 tests renamed method 2023-04-04 15:33:49 +02:00
silverqx fb63c66c7f bump version to TinyORM v0.30.0 and tom v0.5.4
- also bump version to TinyUtils v0.3.0
2023-04-02 16:07:09 +02:00
silverqx e74d987bf5 added mold linker to conf.pri.example
[skip ci]
2023-04-02 13:26:31 +02:00
silverqx 9bccda590e changed Model timestamps to getter methods
Changed from static data members to static getter methods to avoid Clang
crashed because of static initialization order.

 - updated docs
2023-04-02 11:07:17 +02:00
silverqx 23a75a4fc8 used Q_DISABLE_COPY_MOVE() for library classes 2023-04-01 11:03:29 +02:00
silverqx a15a59fe88 enhanced TinyUtils library
Returning reference and shared pointer to the database manager.
2023-04-01 11:03:29 +02:00
silverqx edb33acf31 enhanced TinyUtils library 2023-04-01 11:03:29 +02:00
silverqx c4b70ff337 enabled clang-tidy check
Enabled the performance-move-const-arg.
2023-04-01 11:03:28 +02:00
silverqx 84ecb0322e whitespaces 2023-03-31 16:22:20 +02:00
silverqx 7d2143c3ee tests added add/remove connections test 2023-03-29 16:15:09 +02:00
silverqx daf420e2dc updated .clang-tidy 2023-03-28 13:21:26 +02:00
silverqx 1737568cfd tests qmake removed redundant INCLUDEPATH 2023-03-20 14:04:40 +01:00
silverqx 4737145def tests qmake added $$quote() 2023-03-20 14:04:39 +01:00
silverqx 7cfe84a2e7 tests fixed clang-tidy 16 warning
- cppcoreguidelines-avoid-const-or-ref-data-members
2023-03-20 14:04:39 +01:00
silverqx abc2c9754d tests suppressed clang-tidy 16 warning
The cppcoreguidelines-avoid-do-while inside the QCOMPARE macro.
2023-03-20 14:04:33 +01:00
silverqx a7fdc0f68e suppressed clang-tidy 16 warnings
- misc-use-anonymous-namespace
2023-03-20 13:06:33 +01:00
silverqx 85da16e525 tests removed unused include 2023-03-15 18:27:18 +01:00
silverqx 2bf7562a91 tests bugfix forgotten using alias 2023-03-15 18:24:29 +01:00
silverqx c0dd5e132d added querybuilder.hpp to databasemanager.hpp
Added the #include querybuilder.hpp to the databasemanager.hpp so
everything will be ready if the user includes db.hpp.
2023-03-15 18:15:17 +01:00
silverqx d64b1adf8c tests added todo task 2023-03-15 15:13:09 +01:00
silverqx 5aa69c88b9 schema added optional column and index keywords
For the MySQL schema grammar added:

 - optional column keyword for add, change, or modify alter operations
 - optional index keyword for fulltext and unique index alter operations
2023-03-15 15:03:27 +01:00
silverqx 326ef2aff2 schema removed primary key index name for MySQL
- added tests
2023-03-15 14:10:15 +01:00
silverqx 9b6cc5d335 tests added section names 2023-03-15 13:04:02 +01:00
silverqx de620f9a5a schema bugfix timestamps precision
- added tests
2023-03-15 11:53:42 +01:00
silverqx 6f221d2030 schema added comment 2023-03-15 09:37:37 +01:00
silverqx acdb9d51f6 tests get search_path from original configuration 2023-03-14 17:30:10 +01:00
silverqx 8097037805 schema modifying columns 🔥🚀🥳
Added the change() method which allows to modify the type and attributes
of existing columns.

 - added renameTo() for MySQL which can be used with the change()
 - added tests
 - updated docs
2023-03-14 16:29:07 +01:00
silverqx b7aa3c8598 tests enhanced and unified modifier tests 2023-03-14 12:48:27 +01:00
silverqx 048ee347ee tests fixtypo 2023-03-14 12:48:26 +01:00
silverqx d4105873fe tests bugfix checking if env. variables set 2023-03-14 12:48:24 +01:00
silverqx 8d48a88422 schema finished nullable modifier for MariaDB
MariaDB doesn't support setting a nullable modifier (NULL or NOT NULL)
on generated columns, a query fails if nullable is set. The best that
can be done is to ignore it. 🫤

 - added tests
2023-03-14 12:48:24 +01:00
silverqx b4e9b4b448 tests added comment 2023-03-14 12:48:23 +01:00
silverqx 96fd2545df tests MariaDB SSL configuration 2023-03-14 12:48:22 +01:00
silverqx b97818b67a forced TLS connection for MariaDB
Everywhere, tom, tom_testdata, and tests.
2023-03-14 12:48:22 +01:00
silverqx 7e34fc40d6 tests enhanced tst_postgres/sqlite_qdatetime()
Extracted code to the createQtQuery() method.
2023-03-14 12:48:22 +01:00
silverqx 880bc91317 verified MariaDB support 🔥🚀🎉
Added the MariaDB connections and verified and passed all auto tests.
There was not too much to fix. The TLS connections are still not
enabled.

 - fixed upsert
 - fixed tests
 - enhanced upsert tests
 - refactored tst_mysql_qdatetime to be able test both, the MySQL and
   also MariaDB database connections
 - added a few new MariaDB related tests
2023-03-14 12:48:22 +01:00
silverqx 9fc508c417 tests whitespaces 2023-03-14 12:48:21 +01:00
silverqx 6afbd01b93 schema enhanced generated columns
- refactored PostgreSQL grammar for generated columns
 - unified nullable() on generated columns, now it behaves the same for
   all supported databases and also behaves the same as everywhere else
 - used an optional "generated always as" for all databases instead of
   only "as ()" because it better expresses what it means, "as ()" looks
   very similar like a column alias
 - temporarily disabled logic in MySQL::nullable() for MariaDB, I'm
   going to prepare and set up the MariaDB dev. env. to correctly
   support it, then I will finish it
 - added tests

Others:

 - tests for MySQL and PostgreSQL added tests to test multiple
   auto-increment starting values (startingValue() or from() alias)
2023-03-14 12:48:20 +01:00
silverqx 8ba69dad39 schema changed current_timestamp to lowercase 2023-03-14 12:48:19 +01:00