1.4.0 • Published 6 years ago
plywood-postgres-requester v1.4.0
plywood-postgres-requester
This is the Postgres requester making abstraction layer for plywood.
Given a Postgres query and an optional context it return a Q promise that resolves to the data table.
Installation
To install run:
npm install plywood-postgres-requester
Usage
In the raw you could use this library like so:
postgresRequesterGenerator = require('plywood-postgres-requester').postgresRequester
postgresRequester = postgresRequesterGenerator({
host: 'my.postgres.host',
database: 'all_my_data',
user: 'HeMan',
password: 'By_the_Power_of_Greyskull'
})
postgresRequester({
query: 'SELECT "cut" AS "Cut", sum("price") AS "TotalPrice" FROM "diamonds" GROUP BY "cut";'
})
.then(function(res) {
console.log("The first row is:", res[0])
})
.done()
Although usually you would just pass postgresRequester
into the Postgres driver that is part of Plywood.
Tests
Currently the tests run against a real Postgres database that should be configured (database, user, password) the same as
what is indicated in test/info.coffee
.
1.4.0
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
0.9.3
8 years ago
0.9.2
8 years ago
0.9.1
8 years ago
0.8.8
8 years ago
0.8.7
8 years ago
0.8.6
8 years ago
0.8.5
8 years ago
0.8.4
8 years ago
0.8.3
8 years ago
0.8.2
8 years ago
0.8.1
8 years ago
0.0.1
8 years ago