# billy-sql-postgres

> A Billy service that allows for executing queries against a PostgreSQL datdabase

Latest version **1.2.3** (published 2014-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install billy-sql-postgres
pnpm add billy-sql-postgres
yarn add billy-sql-postgres
bun add billy-sql-postgres
```

## 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.2.3 |
| Published | 2014-09-15 |
| First published | 2014-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Brandon Valosek |
| Maintainers | bvalosek |
| Keywords | billy, sql, postgres, postgresql, billy-service |

## Links

- npm: https://www.npmjs.com/package/billy-sql-postgres
- Repository: git@github.com:bvalosek/billy-sql-postgres
- Homepage: https://github.com/bvalosek/billy-sql-postgres
- Issues: https://github.com/bvalosek/billy-sql-postgres/issues
- npm.io page: https://npm.io/package/billy-sql-postgres

## Dependencies (6)

- [pg](https://npm.io/package/pg.md) ^3.3.0
- [billy](https://npm.io/package/billy.md) 1.x
- [debug](https://npm.io/package/debug.md) ^1.0.1
- [bluebird](https://npm.io/package/bluebird.md) ^2.0.7
- [nodemock](https://npm.io/package/nodemock.md) ^0.3.4
- [sql-params](https://npm.io/package/sql-params.md) ^1.0.1

## Recent versions

- 1.2.3 (latest) — 2014-09-15
- 1.2.2 — 2014-06-25
- 1.2.1 — 2014-06-25
- 1.2.0 — 2014-06-23
- 1.1.0 — 2014-06-10
- 1.0.1 — 2014-05-28
- 1.0.0 — 2014-05-28

## README

# billy-sql-postgres

[![Build Status](https://travis-ci.org/bvalosek/billy-sql-postgres.png?branch=master)](https://travis-ci.org/bvalosek/billy-sql-postgres)
[![NPM version](https://badge.fury.io/js/billy-sql-postgres.png)](http://badge.fury.io/js/billy-sql-postgres)

A [Billy](https://github.com/bvalosek/billy) service that allows for executing
queries against a PostgreSQL database.

## Install

```
$ npm install billy-sql-postgres
```

## Usage

```javascript
var Application = require('billy');
var SqlService  = require('billy-sql-postgres');

var app = new Application();

app.service(SqlService);
app.config('postgres.url', 'posgres://user:pw@127.0.0.1:5432');
```

Use the `sql` dependency in any service or other injected objects:


```javascript
app.service(function(sql) {
  sql.query('select * from widgets').then(function(rows) {
    ...
  });
});
```

Queries are all queued and executed via connections from the internal
connection pool on the `pg` global object.


## Injectables

New dependencies that you can use after adding this service:

 tag | type |description | notes
-----|------|------------|-------
`sql` | `PostgresFacade` | The generic SQL interface | Promise-based `query` interface

## Configs

Available config properties:

 config | type | description | default value | notes
--------|------|-------------|---------------|------
`postgres.url` | `string` | The connection string | `null` | The service will error out if not provided

## Testing

```
$ npm test
```

## License

MIT

---
_Source: https://npm.io/package/billy-sql-postgres · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
