A full-featured PostgreSQL Client for Deno

A full-featured PostgreSQL Client for Deno

pgc4d - PostgreSQL client for Deno .A full-featured PostgreSQL client for Deno including support for:

pgc4d - PostgreSQL client for Deno

A full-featured PostgreSQL client for Deno including support for:

  • Connectivity using TCP, SSL* and Unix domain sockets*
  • Buffered and streaming responses
  • Various shapes of result sets (keyed rows, indexed rows, column, etc.)
  • Asynchronous notifications (using LISTEN and NOTIFY)
  • Arrays, record types and user-defined types (enums)
  • Concurrent queries (queueing)

Philosophical differences from deno-postgres:

  • Does not aim for API compatibility with Node's node-postgres
  • Uses only binary value encoding in client <> server communication
  • No magic detection of data types (is [1, 2, 3] an int[] or a json value?) - see bugs
  • Strict layering of protocol and logic layers - see the interface

(* currently requires --unstable in Deno)

Usage

import { connectPg } from 'https://deno.land/x/pgc4d/src/mod.ts'

const db = await connectPg('postgres://username:[email protected]/database')
try {
    const result = await db.query('SELECT $1::int + $2::int sum', [10, 20])
    assertEquals(result.rows[0].sum, 30)
} finally {
    db.close()
}

Documentation

API documentation

Manual

Contributing

Happy to accept fixes and improvements.

  1. Please add tests for added functionality and ensure CI passes.
  2. Follow the prevalent coding style (no semicolons, no 80-char line limit, single quotes, etc.)

You can use Docker to bring up PostgreSQL and run the tests:

$ docker-compose run ci

Download Details:

Author: jakajancar

Source Code: https://github.com/jakajancar/pgc4d

deno node nodejs javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

AEM Querybuilder for JavaScript (Browser, Node, Deno)

Helix Querybuilder .AEM Querybuilder for JavaScript (Browser, Node, Deno)

NKeys for JavaScript - Node.js, Browsers, and Deno

A public-key signature system based on Ed25519 for the NATS ecosystem system for JavaScript. The nkeys.js library works in Deno, Node.js, and the browser!

Javascript module for easily generating mazes,compatible with both Deno and Node

A work-in-progress Javascript maze generator module, compatible with both Deno and Node.

Deno Tutorial for Beginners: Deno vs. Node: Better Than NodeJS?

Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.

What is Deno? The Node.JS Killer? The Deno-minator to Node?

What is Deno? The Node.JS Killer? The Deno-minator to Node? Deno is the new hype and will it be better than node.js? Deno is a secure runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language that addresses Node’s shortcomings