Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Feel free to request additional features and contribute =)
## Install

```bash
npm i serverless-postgres
npm i serverless-postgres pg
```

## Usage
Expand Down Expand Up @@ -159,7 +159,7 @@ You can then use your plugin like this:
| Property | Type | Description | Default | Version |
|--------------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|---------|
| config | `Object` | A `node-pg` configuration object as defined [here](https://node-postgres.com/api/client) | `{}` | |
| maxConnsFreqMs | `Integer` | The number of milliseconds to cache lookups of max_connections. | `60000` | |
| maxConnsFreqMs | `Integer` | The number of milliseconds to cache lookups of max\_connections. | `60000` | |
| manualMaxConnections | `Boolean` | if this parameters is set to true it will query to get the maxConnections values, to maximize performance you should set the `maxConnections` yourself | `false` | |
| maxConnections | `Integer` | Max connections of your PostgreSQL, it should be set equal to `max_connections` in your cluster. I highly suggest to set this yourself | `100` | |
| strategy | `String` | Name of your chosen strategy for cleaning up "zombie" connections, allowed values `minimum_idle_time` or `ranked` | `minimum_idle_time` | |
Expand All @@ -175,11 +175,5 @@ You can then use your plugin like this:
| processCountFreqMs | `Integer` | The number of milliseconds to cache lookups of process count. | `6000` | |
| allowCredentialsDiffing | `Boolean` | If you are using dynamic credentials, such as IAM, you can set this parameter to `true` and the client will be refreshed | `false` | |
| library | `Function` | Custom postgres library | `require('pg')` | |
| application_name | `String` | This is postgres specific configuration; serverless-pg uses it to avoid closing other applications connections. | `serverless_client` | `>= v2` |
| application\_name | `String` | This is postgres specific configuration; serverless-pg uses it to avoid closing other applications connections. | `serverless_client` | `>= v2` |
| plugin | `Object` | This is where you need to initialize your plugin class | `Postgres` | `>= v2` |

## Note

- `Serverless-postgres` depends on `pg` package and usually you **do not need to install it on your own**.
As some users have observed, if you have installed it on your own, and it is a different version,
this package might misbehave.
60 changes: 40 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
},
"author": "",
"license": "MIT",
"dependencies": {
"pg": "^8.15.6"
"peerDependencies": {
"pg": "^8"
},
"peerDependenciesMeta": {
"pg": {
"optional": true
}
},
"devDependencies": {
"@babel/helper-compilation-targets": "^7.23.6",
Expand All @@ -22,6 +27,7 @@
"aws-xray-sdk": "^3.6.0",
"husky": "^4.3.8",
"jest": "^26.6.3",
"pg": "^8.16.0",
"pg-query-stream": "^4.5.5",
"prettier": "^1.19.1",
"semantic-release": "^19.0.5"
Expand Down