Ah, don’t know why I didn’t grok the extension approach you suggested at first. I like it! That should work well. I’ll give it a shot after we work out the resolution to Atom values in where args treated as schema fields · Issue #2 · mathieuprog/query_builder · GitHub
QueryBuilder v1.0.0 has been released!
New features:
- add the
Extension
module allowing to easily extend QueryBuilder with user’s own functions - add support for offset and limit operations
- differentiate field names vs an atom value with the syntax
:<field_name>@self
vs:<atom_value>
Thanks to @onomated that did all of the work, of high quality!
Because QueryBuilder is considered stable and there have been breaking changes, it has been bumped to 1.0.
Breaking changes:
.1.
QueryBuilder.order_by(User, lastname: :asc)
becomes
QueryBuilder.order_by(User, asc: :lastname)
.2.
QueryBuilder.where(User, {:name, :eq, :nickname})
becomes
QueryBuilder.where(User, {:name, :eq, :nickname@self})
(concerns a comparison of two fields of the root schema)