-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I was looking into custom annotation introduced with c++26 reflection and here is an example on how we can include it in the entities, godbolt
struct Album
{
[[=PrimaryKey::ServerSideAutoIncrement]]
[[=SqlRealName("AlbumId")]]
int32_t AlbumId;
};
struct Field
{
[[=PrimaryKey::ServerSideAutoIncrement, =SqlRealName("TrackId")]] int32_t TrackId;
std::string Name;
[[=SqlRealName("OVERWRITE_BYTES")]] std::optional<int32_t> bytes;
[[=SqlRealName("AlbumId"), =SqlNullable::Null]] BelongsTo<^^Album::AlbumId> AlbumId;
};
I think that the main advantage is that some info can be put inside annotation that is not essential for the entities
and only something that changes behavior of the elements, like BelongsTo is explicitly written since we need custom operators
christianparpart
Metadata
Metadata
Assignees
Labels
No labels