0.0.1 • Published 5 years ago

rsql-js v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

npm.io

RSQL parser and builder for Javascript

Usage:

import {parse, build} from 'rsql-js'

parse('(x==5,y!=3.2);w~="hello"')

build({
  operator: LogicalOperator.And,
  operands: [
    {
      operator: LogicalOperator.Or,
      operands: [
        {
          selector: 'x',
          operator: ComparisonOperator.Equals,
          arguments: 5
        },
        {
          selector: 'y',
          operator: ComparisonOperator.NotEquals,
          arguments: 3.2
        }
      ]
    },
    {
      selector: 'w',
      operator: ComparisonOperator.Like,
      arguments: 'hello'
    }
  ]
})

Operators

  • ==
  • !=
  • ~=
  • !~=
  • >
  • <
  • >=
  • <=
  • =lt=
  • =gt=
  • =le=
  • =ge=
  • =in=
  • =out=