jsgrest
v0.0.6
Published
Postgres REST API server in JavaScript (a la PostgREST)
Downloads
5
Readme
jsgrest
[] (https://travis-ci.org/motiz88/jsgrest) [] (https://coveralls.io/github/motiz88/jsgrest?branch=master)
Postgres REST API server in JavaScript (a la PostgREST).
This is a bare-bones reimplementation of @begriffs's fantastic [PostgREST] (https://github.com/begriffs/postgrest) in JavaScript.
Installing
Node v4 and above is required.
npm install -g jsgrest
Usage
From the command line
jsgrest postgres://postgres:foobar@localhost:5432/my_db \
--port 3000 \
--schema public \
--pure
API
jsgrest
exposes a factory function that returns an Express app, which you
can then use in your own server code.
import createJsgrest from 'jsgrest';
app.use('/db', createJsgrest({
connectionString: 'postgres://postgres:foobar@localhost:5432/my_db',
schema: 'public',
pure: true
}));
Goals
- Maximum API compatibility with PostgREST
- Reasonable performance
- An implementation I can hack on (not being a Haskell coder, I can't do this with PostgREST)
Progress
jsgrest
recently passed a [test suite]
(https://github.com/motiz88/jsgrest/tree/master/test) based largely on PostgREST's own, with some
omissions due to the reduced feature set I'm targeting right now. Following this milestone, I have
my eyes set on achieving full compatibility with PostgREST - help is welcome :smile:.
The issue list is a good place
to see what's missing at the moment. Notably, jsgrest
introduces the concept of "pure" mode,
which disables features that require schema inspection/caching, but non-pure mode is not currently
implemented (#1, [#5]
(https://github.com/motiz88/jsgrest/issues/5), #7).
Tests for "non-pure" and other missing functionality exist but are [flagged with TODO
]
(https://github.com/motiz88/jsgrest/search?utf8=%E2%9C%93&q=TODO) and not run in the main test
suite.
Please feel free to reach out in any way you like. Issue reports, requests, random thoughts and PRs are most welcome.
And hey...
...at least I didn't call it PostgrESt.