https://github.com/jcoreio/get-pg-config
apply default postgres connection config from dotfiles and .pgpass
https://github.com/jcoreio/get-pg-config
node-pg node-postgres pg pgpass postgres postgresql
Last synced: 10 months ago
JSON representation
apply default postgres connection config from dotfiles and .pgpass
- Host: GitHub
- URL: https://github.com/jcoreio/get-pg-config
- Owner: jcoreio
- License: mit
- Created: 2024-05-17T02:21:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-17T02:22:50.000Z (over 1 year ago)
- Last Synced: 2025-03-02T16:49:33.878Z (11 months ago)
- Topics: node-pg, node-postgres, pg, pgpass, postgres, postgresql
- Language: TypeScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @jcoreio/get-pg-config
apply default postgres connection config from dotfiles and .pgpass
[](https://circleci.com/gh/jcoreio/get-pg-config)
[](https://codecov.io/gh/jcoreio/get-pg-config)
[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
[](https://badge.fury.io/js/%40jcoreio%2Fget-pg-config)
This solves two minor problems with `pg`'s default connection parameters:
- it doesn't read `~/.pgpass`/`PGPASSFILE`
- `user` defaults to the OS user. In our work we always use Docker and the `postgres` user,
so we can configure that as the default with the following in `package.json` or `.get-pg-configrc` etc:
```json
"get-pg-config": {
"defaults": {
"user": "postgres"
}
}
```