Also bumped to TinyUtils v0.3.1.
- added ModelsCollection 🔥🚀🎉
- added Models and ModelsCollection serialization using toMap(),
toVector(), and toJson() methods 🪡🔥❤️ (also supports pivot models)
- changed container type for getOperators() to std::unordered_set
- changed paging type to qint64 for paging-related methods like
limit(), offset(), chunk(), take(), ...
- added eagerLoadRelations<Model *>() and eagerLoadRelations(Model &)
overloads
- added Model getKeyCasted<T> and getAttribute<T> overloads
- bugfix zero-initialized related models in belongs-to relations
- bugfix select constraints and belongs-to-many
Internal:
- extracted relation stores to own files
The big HasRelationStore class with nested classes is finally divided
into smaller pieces, every store is in its own file in the Support NS.
Performance is the same as the old code, thanks god. 🙏
mt new: 564
mt old: 565
st new: 959 294
st old: 959 305
Previously, it was the QtTimeZoneType::DontConvert that implied the
Qt::LocalTime timezone spec.
Setting this to the Qt::UTC by default is the only way to have the
maximum level of interoperability between TinyORM and other libraries
and services.
- updated comments in docs and source code
It allows to call eg. getRelationValue() inside these callbacks and
an user can also use const Model *const if needed, so it's much more
flexible.
Also I left const Model * in documentations, I didn't remove the const
from docs, it's on pupropse to show that it's possible.
Missing the PivotType to correctly serialize models collection
with belongs-to-many relations only, eg. after calling the getRelation()
or getRelationValue().
Fix the null QVariant bug for QJsonDocument, replace null QVariant-s
with the QVariant(nullptr).
The QJsonValue should return null for null QVariant-s but it doesn't,
even if the Qt's QJsonValue::fromVariant() documentation explicitly
states this behavior, it says: "If QVariant::isNull() returns true,
a null QJsonValue is returned or inserted into the list or object,
regardless of the type carried by QVariant.".
But this is not happening, it returns 0 for numbers, "" for QString and
QDateTime. 🫤
- updated unit tests
- added unit test method to test this behavior, to test null for all
QVariant types