@rsql/builder
v1.6.0
Published
RSQL High level API
Downloads
19,153
Readme
@rsql/builder
API for building RSQL for Node.js and Browsers
Installation
# with npm
npm install --save @rsql/builder
# with yarn
yarn add @rsql/builder
API
builder.comparison(selector, operator, value): ComparisonNode
Creates new ComparisonNode
- similar to the createComparisonNode
from the @rsql/ast
but with simpler API (no need to create SelectorNode
or ValueNode
and accepts numbers as values)
builder.<operator>(selector, value): ComparisonNode
builder.eq(selector, value): ComparisonNode
builder.neq(selector, value): ComparisonNode
builder.le(selector, value): ComparisonNode
builder.lt(selector, value): ComparisonNode
builder.ge(selector, value): ComparisonNode
builder.gt(selector, value): ComparisonNode
Creates new ComparisonNode
with the predefined operator for single value.
builder.<operator>(selector, values): ComparisonNode
builder.in(selector, values): ComparisonNode
builder.out(selector, values): ComparisonNode
Creates new ComparisonNode
with the predefined operator for multiple values.
builder.logic(expressions, operator): LogicNode
Creates new LogicNode
- similar to the createLogicNode
from the @rsql/ast
but with simpler API (accepts one or more expressions)
builder.<operator>(...expressions): LogicNode
builder.and(...expressions): LogicNode
builder.or(...expressions): LogicNode
Creates new LogicNode
with the predefined operator for one or more expressions.
License
MIT