Replies: 1 comment 1 reply
-
It's possible to use custom SQL. See the :dataset and :eager_loader association options:
Note that you shouldn't need either for what you want. I would guess that it would be better to use the many_through_many plugin (https://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/ManyThroughMany.html), which appears to handle your needs without any custom SQL. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to create a custom SQL in a way how Sequel builds complex queries and automatically load model associations from the query?
I have complex query with many_to_many relation where I need to filter records by income parameter.
I would like to work with instances of Sequel model with associations.
Also I want create a prepared statement for that.
I discovered that prepared statement prepared with eager loading produces N+1.
For example my query:
My schema:
Beta Was this translation helpful? Give feedback.
All reactions