postgrest-syntax-builder
v0.2.0
Published
[](https://circleci.com/gh/amoshydra/postgrest-syntax-builder) [.gt(1),
p.limit(30),
p.not(
p.and(
p('age').gt(18),
p('age').lt(24),
)
),
]
// `result` is evaluated to an array of PostgrestSyntaxBuilder objects
[
{ param: 'age', value: 'gt.1' },
{ param: 'limit', value: '30' },
{ param: 'not.and', value: '(age=gt.18,age=lt.24)' },
]
// PostgrestSyntaxBuilder object extends the native String object, thus it can also be treated and used as String
[
'age=gt.1',
'limit=30',
'not.and=(age=gt.18,age=lt.24)',
]Utility
A reduce function that transform this:
p.reduce(...examples)into this:
{
age: 'gt.1',
limit: 30,
'not.and': '(age=gt.18,age=lt.24)'
}Development
Building from source
yarn buildRun test
yarn testRun example
After the project is built, you can test each built target.
With browser (ES module & UMD)
yarn exampleWith node (CommonJS)
node examplePublishing
This project uses CircleCI to test, build and publish to npm registry. This workflow will be triggered whenever a new version tag is made.

