Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
create
schemas
update
vagrant
Makefile
README.md
Vagrantfile
copy.js
dump.js
find.js
index.js
package.json
remove.js
setup.js
tests.js
tree.js
utils.js

README.md

Jungles Data Postgres (Out of date)

Setup

var data = require('jungles-data-postgres')({
  user: 'james',
  password: '1234',
  database: 'jungles',
  host: '127.0.0.1'
});

data.setup(); // Creates table called instances

API

Data API

Postgres specific

Query objects get translated.

{ id: 5}               // SELECT * FROM instances where id = 5;
{ path: /.*/ }         // SELECT * FROM instance WHERE path ~ .*;
{ path: /.*/, id: 5 }  // SELECT * FROM instances WHERE path ~ .* and id = 5;

Test

mocha.js and should.js is needed. Tests are run against a real database which your can start with vagrant up.

make test