https://github.com/onebeyond/systemic-pg
A systemic pg component
https://github.com/onebeyond/systemic-pg
hacktoberfest
Last synced: about 2 months ago
JSON representation
A systemic pg component
- Host: GitHub
- URL: https://github.com/onebeyond/systemic-pg
- Owner: onebeyond
- License: mit
- Created: 2016-07-14T16:39:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T06:29:07.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T01:15:07.121Z (about 2 months ago)
- Topics: hacktoberfest
- Language: JavaScript
- Size: 224 KB
- Stars: 2
- Watchers: 15
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://codeclimate.com/github/onebeyond/systemic-pg/maintainability)
[](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.