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

postgresql-client

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgresql-client

Professional PostgreSQL client for JavaScript and TypeScript

  • 1.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by13.04%
Maintainers
1
Weekly downloads
 
Created
Source

postgresql-client

NPM Version NPM Downloads Build Status Test Coverage

Professional PostgreSQL client written in TypeScript.

import {Connection} from 'postgresql-client';

const connection = new Connection('postgres://localhost');

const result = await connection.query(
    'select * from cities where name like $1',
    {values: ['%york%']});
const rows = result.rows;
await connection.close(); // Disconnect
import {Pool} from 'postgresql-client';

const db = new Pool({
    host: 'postgres://localhost',
    pool: {
       min: 1,
       max: 10,
       idleTimeoutMillis: 5000
    }
});

const result = await db.query(
    'select * from cities where name like $1',
    {values: ['%york%'], cursor: true});
const cursor = result.cursor;
let row;
while ((row = cursor.next())) {
  console.log(row);
}

await db.close(); // Disconnect all connections and shutdown pool

Features

  • Pure JavaScript library completely written in TypeScript
  • Supports both single connection and pooling
  • Named Prepared Statements
  • Extended cursor support with fast double-link cache
  • Extensible data-types and type mapping
  • Extended bind parameters
  • Multidimensional arrays with fast binary encoding/decoding
  • Low memory utilization and boosted performance with Shared Buffers
  • Full binary and text wire protocol support for all data types
  • Supports Clear text, MD5 and SASL password algorithms
  • Can return both array and object rows
  • Asynchronous Promise based api
  • Strictly typed

Roadmap

  • Support multiple active cursors
  • Extended field info in query result

Installation

$ npm install postgresql-client --save

Documentation

Documentation for detailed usage is here

Support

You can report bugs and discuss features on the GitHub issues page When you open an issue please provide version of NodeJS and PostgreSQL server.

Node Compatibility

  • node >= 10.x

License

postgresql-client is available under MIT license.

Keywords

FAQs

Package last updated on 24 Nov 2020

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