# hapi-pg-promise-multi

> Wrap requests with a pg connection.

Latest version **1.0.4** (published 2020-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install hapi-pg-promise-multi
pnpm add hapi-pg-promise-multi
yarn add hapi-pg-promise-multi
bun add hapi-pg-promise-multi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-07-02 |
| First published | 2020-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Damien SZCZYT |
| Maintainers | kinshish |
| Keywords | hapi, pg, postgres, promise |

## Links

- npm: https://www.npmjs.com/package/hapi-pg-promise-multi
- Repository: https://github.com/KinShish/hapi-pg-promise
- Issues: https://github.com/KinShish/hapi-pg-promise/issues
- npm.io page: https://npm.io/package/hapi-pg-promise-multi

## Dependencies (2)

- [hoek](https://npm.io/package/hoek.md) 6.1.3
- [pg-promise](https://npm.io/package/pg-promise.md) 10.5.7

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2020-07-02
- 1.0.3 — 2020-04-24
- 1.0.2 — 2020-04-16
- 1.0.1 — 2020-04-16
- 1.0.0 — 2020-04-16
- 0.0.1 — 2020-03-27

## README

# hapi-pg-promise-multi

Wrap requests with a Postgres connection using promises.

[![Build Status](https://travis-ci.org/KinShish/hapi-pg-promise.svg?branch=pg-promise)](https://travis-ci.org/KinShish/hapi-pg-promise)
[![dependencies Status](https://david-dm.org/KinShish/hapi-pg-promise/status.svg)](https://david-dm.org/KinShish/hapi-pg-promise)
[![devDependencies Status](https://david-dm.org/KinShish/hapi-pg-promise/dev-status.svg)](https://david-dm.org/KinShish/hapi-pg-promise?type=dev)
[![peerDependencies Status](https://david-dm.org/KinShish/hapi-pg-promise/peer-status.svg)](https://david-dm.org/KinShish/hapi-pg-promise?type=peer)

We use the [`pg-promise`](https://github.com/vitaly-t/pg-promise) (`pg-promise`)


## Install

```bash
$ npm install hapi-pg-promise-multi
```

## Usage

In your request handlers you'll have access to `request.BASE_NAME` which you
can use to make DB requests.

`server.plugins['hapi-pg-promise'].BASE_NAME` is available outside of request
handlers.

### Hapi 18

Current version works with Hapi 18.x.x. For older versions use 1.0.0 of hapi-pg-promise.


#### Register the plugin

```js
const hapiPgPromise = require('hapi-pg-promise-multi');
const plugin = {
    plugin: hapiPgPromise,
    options: [{
        cn: 'postgres://username:password@host:port/database',
        name: 'BASE_NAME',
        settings: {
            // pg-promise options
        }
    },{
        cn: 'postgres://username:password@host:port/database_next',
        name: 'BASE_NAME_NEXT',
        settings: {
            // pg-promise options
        }
    }]
};

server.register(plugin);
```
## Original

[dszczyt/hapi-pg-promise](https://github.com/dszczyt/hapi-pg-promise)


## License

MIT

---
_Source: https://npm.io/package/hapi-pg-promise-multi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
