Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ansaro/lambda-pg

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ansaro/lambda-pg

Connect to Postgres in AWS Lambda environment

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

lambda-pg

Connect to Postgres in AWS Lambda environment

yarn add @ansaro/lambda-pg

Usage

Create a pool connection that can be resused across Lambda invocations.

init takes two arguments:

  • secret string identifier for AWS Secret Manager
  • customTransformer function that transforms secret into Postgres connection object

TODO: document custom secret transformer

const DB = require("@ansaro/lambda-pg");

const db = new DB();

exports.handle = async function() {
  const pool = await db.init("your/db/secret");

  const res = await pool.query("SELECT 1");

  return res;
};

FAQs

Package last updated on 06 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc