Commit Graph

717 Commits

Author SHA1 Message Date
silverqx
f8509700a3 tests fixtypo 2023-05-19 18:01:52 +02:00
silverqx
a1e9f99d7d tests used empty() check instead of 0 2023-05-19 14:18:58 +02:00
silverqx
5f4ef345d2 tests bugfix tst_Collection_Xyz::load_xyz() 2023-05-19 14:15:37 +02:00
silverqx
722fb62e2c tests added QVERIFY(relationLoaded()) 2023-05-19 14:12:09 +02:00
silverqx
c0ff36f0d6 updated comment 2023-05-19 11:43:29 +02:00
silverqx
6d6f536e88 tests updated comment
[skip ci]
2023-05-19 11:38:23 +02:00
silverqx
d9815e9d5a tests test polymorphic Relation instances
Added the test case which tests returning
the std::unique_ptr<Relation<>> instead of the derived relation
eg. std::unique_ptr<HasMany> from the relationship factory methods.
This behavior is considered an additional feature and is possible
thanks to the polymorphism.
2023-05-19 11:19:00 +02:00
silverqx
df118c33ac tests whitespaces 2023-05-18 15:50:21 +02:00
silverqx
fe89d9d53f added comment and whitespaces 2023-05-18 15:42:18 +02:00
silverqx
0b2c435a2f tests used real types instead of auto 2023-05-17 19:23:49 +02:00
silverqx
ec77eaae32 suppressed clang tidy warning
- also formatting
2023-05-17 18:39:07 +02:00
silverqx
5b169a6c41 added ModelsCollection equality operators
Also added equality operator overloads which allow comparing:
ModelsCollection<Model>   == ModelsCollection<Model *>
ModelsCollection<Model *> == ModelsCollection<Model>
2023-05-17 18:31:47 +02:00
silverqx
c631b97000 fixtypo avoid confusion 2023-05-16 17:59:44 +02:00
silverqx
b37147fecf tests extracted common code to library class
Extracted for tst_collection_models/relations tests
to the TestUtils::Common::Collection.
2023-05-16 15:12:50 +02:00
silverqx
58a197a5ca tests used Q_GLOBAL_STATIC_WITH_ARGS() 2023-05-16 14:17:16 +02:00
silverqx
49829bc055 added ModelsCollection::load()
- also added functional tests
2023-05-16 12:51:38 +02:00
silverqx
75a2171975 tests bugfix missing QVERIFY 2023-05-12 09:23:32 +02:00
silverqx
63533c9e07 tests added test 2023-05-11 13:45:15 +02:00
silverqx
997eeba82c tests renamed method 2023-05-11 13:40:18 +02:00
silverqx
64d825caa2 used static_cast for QueryUtils::queryResultSize 2023-05-08 15:00:05 +02:00
silverqx
cdd858777d added Qt5 support for ModelsCollection 2023-05-08 14:09:14 +02:00
silverqx
9e147aa85f changed paging type to qint64
Changed in all paging related methods like chunk(), take(), ...

 - updated unit tests
2023-05-08 13:30:02 +02:00
silverqx
864272d10f models used SIZE_ everywhere
To avoid collisions with Windows header files.
2023-05-07 17:49:20 +02:00
silverqx
98282ab66d tests used SIZE_ everywhere
To avoid collisions with Windows header files.
2023-05-07 17:44:53 +02:00
silverqx
260dab2735 tests renamed local variable 2023-05-07 14:52:42 +02:00
silverqx
9ac6f1bbc5 tests fixed gcc warnings 2023-05-06 15:49:15 +02:00
silverqx
29275a7d33 tests bugfix bad overload selected 2023-05-06 14:49:20 +02:00
silverqx
8698b15e2e updated php migrations script (unfinished) 2023-05-06 14:42:35 +02:00
silverqx
5937044453 sync php seeder unfinished 2023-05-05 14:59:50 +02:00
silverqx
3374929d26 tests removed unused #include 2023-05-05 14:20:45 +02:00
silverqx
71d6e24e28 used NAME constant everywhere 2023-05-05 14:16:45 +02:00
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