jsgrest

0.0.6 • Public • Published

jsgrest

Build Status Coverage Status

Postgres REST API server in JavaScript (a la PostgREST).

This is a bare-bones reimplementation of @begriffs's fantastic 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 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 😄.

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, #7).

Tests for "non-pure" and other missing functionality exist but are flagged with 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.

Dependencies (8)

Dev Dependencies (42)

Package Sidebar

Install

npm i jsgrest

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • motiz88