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

Consider repealing nesting constraint on logical operators #3

Open
numberoverzero opened this issue Aug 8, 2013 · 0 comments
Open

Comments

@numberoverzero
Copy link
Owner

As noted in the readme, this::

{
    "column": "name"
    "operator": "like"
    "value": {
        "operator": "or",
        "value": [
            "Bill",
            "Mary",
            "Steve"
        ]
    }
}

is much more readable than this::

{
    "operator": "or",
    "value": [
        {
            "column": "name",
            "operator": "like",
            "value": "Bill"
        },
        {
            "column": "name",
            "operator": "like",
            "value": "Mary"
        },
        {
            "column": "name",
            "operator": "like",
            "value": "Steve"
        },
    ]
}

By collapsing the redundant information (column and operator) the intent is much more readable.

Concerns while implementing:

  • What's the information propagation limit for values? The above is an easy choice, but what if one of those values wasn't a string, but another node?
  • Can nodes overwrite operator values defined above? What if in the first snipped the user wants to use the like operator for 11 names but then use ilike the operator for "Mary"? Could they make the element a node that overrides operator, or do they have to nest the above in another OR to include the field?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant