Skip to content

Commit cd6a0ad

Browse files
Fdawgsclimba03003
andauthored
docs(readme): spelling and grammar fixes; http link to https (#78)
* docs(readme): spelling and grammar fixes * docs(readme): add badges * docs(readme): upgrade http links to https * docs(readme): fix broken nearform link Co-authored-by: KaKa <[email protected]> Co-authored-by: KaKa <[email protected]>
1 parent 6a6d6db commit cd6a0ad

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# fastify-postgres
22

3-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
4-
![CI
5-
workflow](https://github.com/fastify/fastify-postgres/workflows/CI%20workflow/badge.svg)
3+
![CI](https://github.com/fastify/fastify-postgres/workflows/CI%20workflow/badge.svg)
4+
[![NPM version](https://img.shields.io/npm/v/fastify-postgres.svg?style=flat)](https://www.npmjs.com/package/fastify-postgres)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-postgres/badge.svg)](https://snyk.io/test/github/fastify/fastify-postgres)
6+
[![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-postgres/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-postgres?branch=master)
7+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
68

7-
Fastify PostgreSQL connection plugin, with this you can share the same PostgreSQL connection pool in every part of your server.
8-
Under the hood the [node-postgres](https://github.com/brianc/node-postgres) is used, the options that you pass to `register` will be passed to the PostgreSQL pool builder.
9+
Fastify PostgreSQL connection plugin; with this, you can share the same PostgreSQL connection pool in every part of your server.
10+
Under the hood [node-postgres](https://github.com/brianc/node-postgres) is used, the options that you pass to `register` will be passed to the PostgreSQL pool builder.
911

1012
## Install
1113
```
1214
npm i pg fastify-postgres --save
1315
```
1416
## Usage
15-
Add it to you project with `register` and you are done!
16-
This plugin will add the `pg` namespace in your Fastify instance, with the following properties:
17+
Add it to your project with `register` and you are done!
18+
This plugin will add the `pg` namespace to your Fastify instance, with the following properties:
1719
```
1820
connect: the function to get a connection from the pool
1921
pool: the pool instance
@@ -145,7 +147,7 @@ fastify.listen(3000, err => {
145147
})
146148
```
147149

148-
As you can see there is no need to close the client, since is done internally. Promises and async await are supported as well.
150+
As you can see there is no need to close the client, since it is done internally. Promises and async await are supported as well.
149151

150152
### Name option
151153
If you need to have multiple databases set up, then you can name each one of them by passing `name: 'foo'`. It will then be accessible as `fastify.pg.foo`.
@@ -175,9 +177,9 @@ fastify.listen(3000, err => {
175177
```
176178

177179
### Native option
178-
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.
180+
If you want maximum performance you can install [pg-native](https://github.com/brianc/node-pg-native), and pass `native: true` to the plugin options.
179181
*Note: it requires PostgreSQL client libraries & tools installed, see [instructions](https://github.com/brianc/node-pg-native#install).*
180-
Note: trying to use native options without successfully installation of `pg-native` will get a warning and fallback to regular `pg` module.
182+
Note: trying to use native options without successfully installation of `pg-native` will return a warning and fallback to regular `pg` module.
181183

182184
```js
183185
const fastify = require('fastify')()
@@ -231,7 +233,7 @@ fastify.listen(3000, err => {
231233
```
232234

233235
### Transact route option
234-
It's possible to automatically wrap a route handler in a transaction by using the `transact` option when registering a route with Fastify. Note that the option must be scoped within a `pg` options object to take effect.
236+
It is possible to automatically wrap a route handler in a transaction by using the `transact` option when registering a route with Fastify. Note that the option must be scoped within a `pg` options object to take effect.
235237

236238
`query` commands can then be accessed at `request.pg` or `request.pg[name]` and `transact` can be set for either the root pg client with value `true` or for a pg client at a particular namespace with value `name`. Note that the namespace needs to be set when registering the plugin in order to be available on the request object.
237239

@@ -305,8 +307,8 @@ $ npm test
305307
## Acknowledgements
306308

307309
This project is kindly sponsored by:
308-
- [nearForm](http://nearform.com)
309-
- [LetzDoIt](http://www.letzdoitapp.com/)
310+
- [nearForm](https://www.nearform.com)
311+
- [LetzDoIt](https://www.letzdoitapp.com/)
310312

311313
## License
312314

0 commit comments

Comments
 (0)