@norjs/pgrunner
PostgreSQL Database Server Runner for Node.js
Last updated 3 months ago by jhh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @norjs/pgrunner 
SYNC missed versions from official npm registry.

@norjs/pgrunner (Originally sendanor/nor-pgrunner)

Utility which can be used to start PostgreSQL server instances temporarely. Good for testing.

Installation

Install from NPM: npm install -g pgrunner

Usage over CLI

Use with CLI:

pgrunner create
pgrunner destroy

Usage over Node.js

Use with Node.js:

var pgrunner = require('nor-pgrunner');

Example usage:

pgrunner({
	'host': '127.0.0.1',  // Defaults to '127.0.0.1'
	'port': 55432,        // Defaults to '55432'
	'user': 'foo',        // Defaults to USER from ENV
	'database': 'dbname'  // Defaults to same value as the user option
}).then(function(server) {
	
	// server.pgconfig is a string like 'pg://jhh@127.0.0.1:55432/jhh'
	// server.settings has the same options as properties: host, port, user, database
	// server.env has the environment variables the server is using
	
	// Stop the instance
	return server.stop().then(function() {
		console.log('Stopped successfully');
	});

}).fail(function(err) {
	console.log('Error: ' + err);
}).done();

Commercial Support

You can buy commercial support from Sendanor.

Current Tags

  • 1.3.2                                ...           latest (3 months ago)

2 Versions

  • 1.3.2                                ...           3 months ago
  • 1.3.1                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 2
Last Day 2
Last Week 0
Last Month 9
Dependencies (8)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |