You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ This plugin will add the `pg` namespace in your Fastify instance, with the follo
15
15
```
16
16
connect: the function to get a connection from the pool
17
17
pool: the pool instance
18
-
Client: a clinet constructor for a single query
18
+
Client: a client constructor for a single query
19
19
query: an utility to perform a query without a transaction
20
20
```
21
21
@@ -95,6 +95,34 @@ fastify.listen(3000, err => {
95
95
```
96
96
As you can see there is no need to close the client, since is done internally. Promises and async await are supported as well.
97
97
98
+
### Native option
99
+
If you want to gain the maximum performances you can install [pg-native](https://github.com/brianc/node-pg-native), and pass `native: true` to the plugin options.
100
+
*Note: it requires PostgreSQL client libraries & tools installed, see [instructions](https://github.com/brianc/node-pg-native#install).*
101
+
Note: trying to use native options without successfully installation of `pg-native` will get a warning and fallback to regular `pg` module.
0 commit comments