npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sisaljs/pg

v0.12.0

Published

PostgreSQL adapter for Sisal: typed ORM execution, dialect-aware SQL rendering, connection pooling, and migrations.

Readme

@sisal/pg

PostgreSQL adapter boundary for Sisal.

@sisal/pg depends on @sisal/orm and @sisal/migrate; neither package depends on @sisal/pg. It provides PostgreSQL database execution, connection pooling, migration history storage, migrators, and additive DDL generation.

import { createPgDb } from "@sisal/pg";

const db = await createPgDb({
  url: Deno.env.get("DATABASE_URL"),
});

Choosing a driver

@sisal/pg runs on either of two PostgreSQL drivers behind the same query builder and executor — the only difference is the connection option, so application code is identical:

// Default: postgres.js (`npm:postgres`), imported lazily on the
// first connect. Sets TCP_NODELAY and pipelines the protocol — ~100× faster
// per parameterized query than `@db/postgres`'s extended-protocol path. Set
// `prepare: false` for PgBouncer/Neon-pooled endpoints.
const db = await createPgDb({ url });

// Pure-JSR `jsr:@db/postgres` — select it to keep the
// process npm-free.
const jsrOnly = await createPgDb({ url, driver: "db-postgres" });

Both pass the full @sisal/pg compatibility matrix (PostgreSQL 16/17/18), including identical bigint (int8 → string) decoding. The migrate boundary (@sisal/pg/migrate) stays on @db/postgres — migrations are short-lived and latency-insensitive, and this keeps sisal CLI runs npm-free. The full analysis lives in the repository at perf/PG_ADAPTER_PERF_REPORT.md.

For only DDL generation:

import { generatePostgresUpStatements } from "@sisal/pg/ddl";

Adapter checklist

| Question | Answer | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Driver | ORM connections use lazy npm:postgres by default or jsr:@db/postgres when driver: "db-postgres" is selected. Migration execution uses @db/postgres. | | Permissions | --allow-env for DSNs, --allow-net=<host>:<port> for live connections, and --allow-read when loading local config/migrations. | | Migrations | Yes: @sisal/pg/migrate, PostgreSQL history store, advisory locks, and @sisal/pg/ddl. | | Transactions/batch | Interactive transactions and atomic db.batch are supported through scoped executors. | | Dialect limitations | PostgreSQL-family features are capability-gated by dialectIdentity; int8 decodes as string to avoid precision loss. | | Security caveats | Treat DSNs as secrets, prefer TLS for remote hosts, and keep raw SQL/migration files developer-authored. Driver errors are redacted before surfacing through Sisal errors. | | ETL | Works with @sisal/etl; PostgreSQL is the primary live-proven ETL target. | | Analytics | Works with @sisal/analytics; PostgreSQL has live integration proof for bucket/window/previous-window analytics. |