-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Having real typed query system #11
Comments
Here is the code for Drift query builder https://github.com/simolus3/drift/tree/develop/drift/lib/src/runtime/query_builder
So they decided to have a Dart SQL way to query data. For angel3, they generate a Query class for each model that allow querying like this:
Full example here. I prefer that last approach and I think that can be included into stormberry "simply" by modifying the generated repositories. Currently repos have query one, query many, insert, update, delete. When digging into queries methods I see it uses This new class would handle a generated Where class with the SQL column of the generated view to build the where clause. That would allow to remove the I could try to go that way if you are happy with that direction @schultek. Hope that's clear enough lol or let me know ^^ |
I also like the second approach more, but it seems to be limited to simple queries on the single table, so no joins or more complex queries. Is that enough or do we want to also support more complex queries? |
Let's start like this to not start too big at once ^^ but nothing prevent us to generate sub Query class for nested field association to unlock complex query. |
Ok sounds good. |
Doing queries with where on multiple fields is currently limited as SQL need to be written manually.
The text was updated successfully, but these errors were encountered: