serverless-pg
A PostgreSQL client for Node.js serverless applications.
Note: This library is currently alpha and subject to breaking changes. Please install this dependency using an exact version.
About
This module is intended for use in node.js serverless applications. It supports node v8 and above. It is simply some boilerplate around the fantastic pg
library for serverless apps.
Installation
npm install serverless-pg --save-exact
How to use
First, setup your client in a dedicated module:
// client.js ; const dbClient = ; ;
Then, import anywhere in your application and use.
// handler.js ; const handler = async { // calling query automagically connects to the database await dbClient; await dbClient; await dbClient;};