Skip to content

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

Open

Description

@hstanford

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.

Activity

  1. brianc commented on Aug 5, 2017

    @brianc
    Owner
  2. hstanford commented on Aug 6, 2017

    @hstanford
    ContributorAuthor

    Thanks! Pull request submitted #370

  3. seokgyo commented on Sep 12, 2017

    @seokgyo

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions