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

coding.sh-store-postgres

v0.1.6

Published

Postgres store for coding.sh, observability and evals for any AI agent: point CODING_SH_STORE_URL at postgres:// and run serve, the CLI, MCP and evals on one database.

Readme

coding.sh-store-postgres

Postgres storage for coding.sh. Install it next to coding.sh and point the store URL at a database. coding.sh serve, the CLI, MCP tools, datasets and experiments then all read and write that database.

npm i -g coding.sh coding.sh-store-postgres
export CODING_SH_STORE_URL='postgres://coding:[email protected]:5432/coding?sslmode=require'
coding.sh serve

The core package loads this plugin by its name (coding.sh-store-<scheme>), so there is nothing to register. Both postgres:// and postgresql:// work. When the index is on Postgres, blobs default to the same database. Set CODING_SH_BLOB_URL=s3://… to keep them in object storage instead.

URL

postgres://user:pass@host:5432/db?sslmode=require&schema=coding_sh&pool_max=10

| Parameter | Default | Meaning | |---|---|---| | schema | public | Created if missing. Separate deployments can share a database with separate schemas. | | pool_max | 10 | Connections in the pool. The writer lock uses one more. | | anything else | | Passed to pg as is (sslmode, host=/socket/dir, …). |

Statements time out after 30 s.

What it stores

The tables mirror the SQLite store: events, sessions, cursors, tasks, bundles, runs, labels, kv, datasets, dataset_latest, experiments, judges and blobs, plus coding_sh_migrations.

  • Migrations run on open, in one transaction under an advisory lock, so replicas can start together.
  • events and sessions carry project_id (default when unset).
  • JSON fields are text holding JSON, so stats::jsonb->>'events' works in ad-hoc SQL.
  • putEvents is idempotent: retries and replays never duplicate an event.
  • Full-text search uses a GIN-indexed tsvector over diacritic-folded terms. It needs no extensions. Each event indexes up to 200,000 characters of text.
  • coding.sh serve takes a session advisory lock per schema, so only one replica writes. It needs a direct connection or a session-mode pooler. Transaction-mode poolers drop session locks.
  • Blobs are zstd-compressed bytea rows keyed by sha256.
  • --where (the query language) runs in the database as one parameterized statement: every session and event key, has:, is:, bare words (on the tsvector), sort:, limit: and --facets. Event keys use the events (session_id, …) index. A key this plugin doesn't know yet, from a newer coding.sh, fails with unsupported_store.

Tests

The conformance suite from coding.sh/store/conformance and the Postgres-specific tests run against CODING_SH_TEST_PG_URL. They skip when it is unset. Each test creates a schema t_<random> and drops it afterwards. npm ci builds this package's dist/ through its prepare script; after editing src/, rebuild with npm run build -w coding.sh-store-postgres.

npm run build -w coding.sh
CODING_SH_TEST_PG_URL=postgres://coding:[email protected]:5432/coding npm test -w coding.sh-store-postgres