# pg-sql-tag

> A pg plugin for `sql-tag`

Latest version **0.0.2** (published 2016-08-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install pg-sql-tag
pnpm add pg-sql-tag
yarn add pg-sql-tag
bun add pg-sql-tag
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-08-17 |
| First published | 2015-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rui Marinho |
| Maintainers | ruimarinho |
| Keywords | es6, multiline, pg, plugin, postgres, sql, sql-tag, string, strings, tagged, template |

## Links

- npm: https://www.npmjs.com/package/pg-sql-tag
- Repository: https://github.com/seegno/pg-sql-tag
- Issues: https://github.com/seegno/pg-sql-tag/issues
- npm.io page: https://npm.io/package/pg-sql-tag

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-08-17
- 0.0.1 — 2015-02-24

## README

# pg-sql-tag

A [pg](https://github.com/brianc/node-postgres) plugin for [sql-tag](https://www.npmjs.com/package/sql-tag), combinining the elegance of tagged sql query strings with the convenience and safety of `pg.query`.

## Status

This module has been deprecated in favour of [sql-tag@^1.0.0](https://github.com/seegno/sql-tag), which is now able to handle `pg` queries without requiring any modification to `pg.query`.

[![maintenance status][maintenance-image]]()
[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]

## Installation

Install the package via `npm`:

```bash
$ npm install pg-sql-tag
```

## Usage

```js
var pg = require('pg');
var sql = require('sql-tag');

// Wrap `pg` in order to support queries
// generated by the `sql` tag.
require('pg-sql-tag')(pg);

// Use expressions inside placeholders to build elegant
// and readable queries.
pg.query(sql`SELECT * FROM "Foo" WHERE id = ${ 1 * 2 }`, function(err, result) {
  if (err) {
    throw err;
  }

  console.log(result);
});

// You can even use function calls inside expressions.
var obj = { foo: 'bar' }

pg.query(sql`UPDATE "Foo" SET biz = ${ JSON.stringify(obj) }`, function(err, result) {
  if (err) {
    throw err;
  }

  console.log(result);
});
```

## Tests

```
$ npm test
```

## License

MIT

[maintenance-image]: https://img.shields.io/maintenance/no/2016.svg?style=flat-square
[npm-image]: https://img.shields.io/npm/v/pg-sql-tag.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/pg-sql-tag
[travis-image]: https://img.shields.io/travis/seegno/pg-sql-tag/v0.0.2.svg?style=flat-square
[travis-url]: https://travis-ci.org/seegno/pg-sql-tag

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