Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norjs/pgrunner
PostgreSQL Database Server Runner for Node.js
https://github.com/norjs/pgrunner
Last synced: about 1 month ago
JSON representation
PostgreSQL Database Server Runner for Node.js
- Host: GitHub
- URL: https://github.com/norjs/pgrunner
- Owner: norjs
- License: mit
- Created: 2019-01-05T20:59:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T00:46:28.000Z (over 3 years ago)
- Last Synced: 2024-08-10T09:59:34.274Z (5 months ago)
- Language: JavaScript
- Size: 83 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@norjs/pgrunner (Originally [sendanor/nor-pgrunner](https://github.com/sendanor/nor-pgrunner))
=========================================Utility which can be used to start PostgreSQL server instances temporarely. Good for testing.
### Installation
Install from NPM: `npm install -g @norjs/pgrunner`
### Usage over CLI
Use with CLI:
```
norjs-pgrunner create
norjs-pgrunner list
norjs-pgrunner destroy
```### Usage over Node.js
Use with Node.js:
```
var pgrunner = require('@norjs/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://[email protected]: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](http://sendanor.com/).