Hook.io hook for talking to Postgres
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
.gitignore
ReadMe.md
config.json.template
package.json

ReadMe.md

hook.io-postgres

Hook.io Postgres is a client-wrapper around pg for querying a postgres database.

Installation

 git clone git@github.com:paulbellamy/hook.io-postgres.git
 cd hook.io-postgres
 npm install
 node bin/postgres

Using NPM

npm install hook.io-postgres
hookio-postgres --debug

Note: Using the default options hookio-postgres will attempt to connect to pg://localhost/mydatabase

Hook Event Names

Event Listeners

postgres::query string - Run a sql query and pass the results to the callback.

postgres::query array - Run a sql query (with arguments) and pass the results to the callback.

postgres::query {text, name, values} - Run a named sql query and pass the results to the callback.

Event Emitters

postgres::connected event emitted when the hook is connected to postgres

postgres::error event emitted when there is an error talking to postgres

Hook config.json data

{
  "database": {
    "host": "/var/run/postgresql",
    "port": 5432,
    "user": "username",
    "password": "password",
    "database": "mydatabase"
  }
}