Skip to content

Commit 1655387

Browse files
authored
Update readme to fix code samples (#35)
Based on #34 I think that was a no :)
1 parent aebb2b2 commit 1655387

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ transact: a utility to perform multiple queries _with_ a transaction
2424

2525
Example:
2626
```js
27-
const fastify = require('fastify')
27+
const fastify = require('fastify')()
2828

2929
fastify.register(require('fastify-postgres'), {
3030
connectionString: 'postgres://postgres@localhost/postgres'
@@ -54,7 +54,7 @@ fastify.listen(3000, err => {
5454

5555
Async await is supported as well!
5656
```js
57-
const fastify = require('fastify')
57+
const fastify = require('fastify')()
5858

5959
fastify.register(require('fastify-postgres'), {
6060
connectionString: 'postgres://postgres@localhost/postgres'
@@ -76,7 +76,7 @@ fastify.listen(3000, err => {
7676
```
7777
Use of `pg.query`
7878
```js
79-
const fastify = require('fastify')
79+
const fastify = require('fastify')()
8080

8181
fastify.register(require('fastify-postgres'), {
8282
connectionString: 'postgres://postgres@localhost/postgres'
@@ -99,7 +99,7 @@ fastify.listen(3000, err => {
9999

100100
Use of `pg.transact`
101101
```js
102-
const fastify = require('fastify')
102+
const fastify = require('fastify')()
103103

104104
fastify.register(require('fastify-postgres'), {
105105
connectionString: 'postgres://postgres@localhost/postgres'
@@ -153,7 +153,7 @@ If you want to gain the maximum performances you can install [pg-native](https:/
153153
Note: trying to use native options without successfully installation of `pg-native` will get a warning and fallback to regular `pg` module.
154154

155155
```js
156-
const fastify = require('fastify')
156+
const fastify = require('fastify')()
157157

158158
fastify.register(require('fastify-postgres'), {
159159
connectionString: 'postgres://postgres@localhost/postgres',
@@ -179,7 +179,7 @@ fastify.listen(3000, err => {
179179
If you want to provide your own `pg` module, for example to support packages like [`pg-range`](https://www.npmjs.com/package/pg-range), you can provide an optional `pg` option with the patched library to use:
180180

181181
```js
182-
const fastify = require('fastify')
182+
const fastify = require('fastify')()
183183
const pg = require("pg");
184184
require("pg-range").install(pg)
185185

0 commit comments

Comments
 (0)