Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guidesmiths/systemic-pg
A systemic pg component
https://github.com/guidesmiths/systemic-pg
hacktoberfest
Last synced: about 1 month ago
JSON representation
A systemic pg component
- Host: GitHub
- URL: https://github.com/guidesmiths/systemic-pg
- Owner: onebeyond
- License: mit
- Created: 2016-07-14T16:39:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T06:29:07.000Z (about 1 year ago)
- Last Synced: 2024-05-16T23:53:14.910Z (4 months ago)
- Topics: hacktoberfest
- Language: JavaScript
- Size: 224 KB
- Stars: 2
- Watchers: 16
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Maintainability](https://api.codeclimate.com/v1/badges/8fd0f7468cac4f37fd50/maintainability)](https://codeclimate.com/github/onebeyond/systemic-pg/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/8fd0f7468cac4f37fd50/test_coverage)](https://codeclimate.com/github/onebeyond/systemic-pg/test_coverage)# systemic-pg
A [systemic](https://github.com/guidesmiths/systemic) pg component## Usage
```js
const System = require('systemic')
const postgres = require('systemic-pg')new System()
.configure({
postgres: {
host: 'localhost',
database: 'example'
onConnect: [
"SET client_min_messages = WARNING",
"SET search_path = custom,public"
]
}
})
.add('logger', console)
.add('postgres', postgres()).dependsOn('config', 'logger')
.start((err, components) => {
// Do stuff with components.pg
})
```### <= 0.12
systemic-pg relies on the underlying [pg](https://github.com/brianc/node-postgres) library, which uses native promises and is therefore incompatible with node 0.12 and below. You can monkey patch Promise or use an alternative promise implementation by following [these](https://github.com/brianc/node-pg-pool#bring-your-own-promise) instructions.