Skip to content
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

[Feature Request] Expose generic unary, binary and ternary operators #369

Open
hstanford opened this issue Aug 5, 2017 · 3 comments
Open

Comments

@hstanford
Copy link
Contributor

hstanford commented Aug 5, 2017

It would be useful to allow syntax similar to

var query = user.select(user.id).where(user.name.binary('<@>', 'example'));

('<@>' is a placeholder operator, focus is the 'binary' node)
The interface of each function could be:

...unary(operator)
...binary(operator, val)
...ternary(operator, separator, middle, right) 

Or perhaps a single 'operation' method that would decide whether to use a unary, binary or ternary node depending on the number of arguments:

...operation(operator, ...)

This would be useful for implementing currently unsupported operators like '<->' in postgres (new in 9.6) or even user-defined operators.
Would you be happy to support this? I am happy to submit a pull request.

@brianc
Copy link
Owner

brianc commented Aug 5, 2017 via email

@hstanford
Copy link
Contributor Author

Thanks! Pull request submitted #370

@seokgyo
Copy link

seokgyo commented Sep 12, 2017

This looks very cool? Is there any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants