1- # fastify- postgres
1+ # @ fastify/ postgres
22
33![ CI] ( https://github.com/fastify/fastify-postgres/workflows/CI/badge.svg )
4- [ ![ NPM version] ( https://img.shields.io/npm/v/fastify- postgres.svg?style=flat )] ( https://www.npmjs.com/package/fastify- postgres )
4+ [ ![ NPM version] ( https://img.shields.io/npm/v/@ fastify/ postgres.svg?style=flat )] ( https://www.npmjs.com/package/@ fastify/ postgres )
55[ ![ Known Vulnerabilities] ( https://snyk.io/test/github/fastify/fastify-postgres/badge.svg )] ( https://snyk.io/test/github/fastify/fastify-postgres )
66[ ![ Coverage Status] ( https://coveralls.io/repos/github/fastify/fastify-postgres/badge.svg?branch=master )] ( https://coveralls.io/github/fastify/fastify-postgres?branch=master )
77[ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat )] ( https://standardjs.com/ )
@@ -11,7 +11,7 @@ Under the hood [node-postgres](https://github.com/brianc/node-postgres) is used,
1111
1212## Install
1313```
14- npm i pg fastify- postgres --save
14+ npm i pg @ fastify/ postgres --save
1515```
1616## Usage
1717Add it to your project with ` register ` and you are done!
@@ -28,7 +28,7 @@ Example:
2828``` js
2929const fastify = require (' fastify' )()
3030
31- fastify .register (require (' fastify- postgres' ), {
31+ fastify .register (require (' @ fastify/ postgres' ), {
3232 connectionString: ' postgres://postgres@localhost/postgres'
3333})
3434
@@ -58,7 +58,7 @@ Async await is supported as well!
5858``` js
5959const fastify = require (' fastify' )()
6060
61- fastify .register (require (' fastify- postgres' ), {
61+ fastify .register (require (' @ fastify/ postgres' ), {
6262 connectionString: ' postgres://postgres@localhost/postgres'
6363})
6464
@@ -80,7 +80,7 @@ Use of `pg.query`
8080``` js
8181const fastify = require (' fastify' )()
8282
83- fastify .register (require (' fastify- postgres' ), {
83+ fastify .register (require (' @ fastify/ postgres' ), {
8484 connectionString: ' postgres://postgres@localhost/postgres'
8585})
8686
@@ -103,7 +103,7 @@ Use of `pg.transact`
103103``` js
104104const fastify = require (' fastify' )()
105105
106- fastify .register (require (' fastify- postgres' ), {
106+ fastify .register (require (' @ fastify/ postgres' ), {
107107 connectionString: ' postgres://postgres@localhost/postgres'
108108})
109109
@@ -156,7 +156,7 @@ You can use both unnamed and named postgres connections at once. There can be on
156156``` js
157157const fastify = require (' fastify' )()
158158
159- fastify .register (require (' fastify- postgres' ), {
159+ fastify .register (require (' @ fastify/ postgres' ), {
160160 connectionString: ' postgres://postgres@localhost/postgres' ,
161161 name: ' foo'
162162})
@@ -184,7 +184,7 @@ Note: trying to use native options without successfully installation of `pg-nati
184184``` js
185185const fastify = require (' fastify' )()
186186
187- fastify .register (require (' fastify- postgres' ), {
187+ fastify .register (require (' @ fastify/ postgres' ), {
188188 connectionString: ' postgres://postgres@localhost/postgres' ,
189189 native: true
190190})
@@ -212,7 +212,7 @@ const fastify = require('fastify')()
212212const pg = require (" pg" );
213213require (" pg-range" ).install (pg)
214214
215- fastify .register (require (' fastify- postgres' ), {
215+ fastify .register (require (' @ fastify/ postgres' ), {
216216 connectionString: ' postgres://postgres@localhost/postgres' ,
217217 pg: pg
218218})
0 commit comments