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
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
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
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
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
- 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)