These Appends are appended to the serialized models during the toMap(),
toVector(), or toJson() methods call.
Appends names are and must be mapped using the u_mutators hash map
(in the same way like u_relations) because c++ doesn't support advanced
reflection.
Appends are mapped to methods (can be protected) that return
the Casts::Attribute. This Casts::Attribute is a wrapper to return
a new attribute value.
Appends accept u_visible and u_hidden.
For the Appends that return QDate or QDateTime are the counterpart
serializeDate() or serializeDateTime() methods called.
- added unit tests
A user can define the u_visible and u_hidden std::set static data
member for visible and hidden attributes on his models and they will be
used during serialization.
The relationships and also u_snakeAttributes are correctly taken into
account.
- added unit tests
- added example to Models::Torrent
On libc++ based systems, the std::variant type provided by the <variant>
header is different to the one prototyped in ormconcepts.hpp, causing a
compilation failure.
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.