-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template arguments for associations #45
Comments
Oh nice, i'm absolutely open to this. But I am pretty sure I had these cass and they compiled, hmm... 🤔 edit: wouldn't it make more sense to name it something like |
Yes, indeed, associations will be much more clear in a such way, and look similar to ruby's |
I tried to implement
|
Ok, so here is how to deduce variadic with types/literals using reflection |
NB: With the draft-PR on static reflection, we have to adapt the way of how associations work anyways. It seems like we're moving away from the Active Record model towards Data Mapper model in order to satisfy some requirements of C++20, to get static reflection in early (i.e. the Record type must be an aggregate, i.e., we can't use inheritance nor private membmers, just plain structs without any constructor. Plus side is: modeling the SQL tables into structs becomes way more natural) EDIT: We should still persure something like |
https://godbolt.org/z/KPYaTcEds
I think it might be good to have following syntax for complex associations
And
HasManyThrough<A,B> records;
will fail to compileThe text was updated successfully, but these errors were encountered: