OSS TanbouSign in with GitHub

build parameterized SQL safely through tagged templates with a lightweight PostgreSQL client

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
8,728
Primary language
JavaScript
License
Unlicense
Repository last updated
Sep 2, 2026
On this page

Overview

Postgres.js is a PostgreSQL client for Node.js, Deno, Bun, and Cloudflare runtimes. Its API centers on ES6 tagged templates, separating interpolated values into PostgreSQL parameters while keeping SQL visible in application code.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Turn tagged-template values into PostgreSQL parameters automatically

Values interpolated into sql tagged templates become placeholders such as $1 and are sent separately from SQL text. Helpers also cover dynamic identifiers and insert or update construction.

Sources: [1]

Use transactions, cursors, LISTEN/NOTIFY, and dynamic query fragments through one API

The client provides transactions, cursor-based iteration, dynamic SQL fragments, LISTEN/NOTIFY, custom types, and other PostgreSQL-oriented features without a large abstraction layer.

Sources: [1]

Best fit

Fits Next.js and Node.js backends that want explicit SQL with a small driver layer

It is useful when teams prefer writing SQL directly while delegating parameterization and connection handling to a focused PostgreSQL client rather than an ORM.

Sources: [1][3]

Before adoption

Separate dynamic identifiers from ordinary user-provided values

Ordinary value interpolation is parameterized, while table and column identifiers use dedicated helpers such as sql(identifier). Do not pass arbitrary user input as identifiers without an allowlist.

Sources: [1]

Review connection and transaction lifecycles for serverless and edge deployments

The package exports builds for Node.js, Deno, Bun, and workerd, but database connection limits and proxy or pooler compatibility still depend on the deployment provider. Version 3.4.9 declares Node 12+.

Sources: [3]

Official sources

  1. [1]Postgres.js v3.4.9 README(2026-10-06)
  2. [2]Postgres.js v3.4.9 release(2026-10-06)
  3. [3]Postgres.js v3.4.9 package metadata(2026-10-06)
Supplemental curator note

It fits backends that want explicit SQL with a small driver layer. Distinguish values from identifiers and review connection lifecycles in serverless deployments.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/porsager/postgres.git
  2. 2

    Enter the repository

    cd postgres
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

8,728 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
72

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • postgresql
  • postgres
  • database
  • nodejs
  • driver
  • client
  • deno
  • cockroachdb
Stars
8,728
Forks
382
Watchers
48
Open issues
252
Contributors
77
Owner type
User
Primary language
JavaScript
License
Unlicense
Repository last updated
Sep 2, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?