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

@rindle/query-compiler

v0.10.5

Published

Compiles a Rindle query AST to one SQL SELECT (whole nested result as a single JSON column) for a live SQL backend — the server realization of 203-MUTATOR-READS Phase 2 (POSTGRES-READ-COMPILER-DESIGN.md). Postgres dialect drives the BYO-Postgres mutator r

Readme

@rindle/query-compiler

Compiles a Rindle query Ast into one SQL SELECT whose single column "rindle_result" is the entire nested result tree as JSON — the server-side realization of 203-MUTATOR-READS-DESIGN.md Phase 2, specified in POSTGRES-READ-COMPILER-DESIGN.md.

A server mutator runs the compiled SELECT on its already-open Postgres transaction, so it reads its own uncommitted writes for free (read-your-writes). Compilation is a pure function of (Ast, Catalog) — no database round-trip to plan a read, only to run it.

compile(ast, catalog, { dialect: "postgres" })  →  { sql, params }

Site docs — the mutator reads (yield tx.query) this compiler serves: rindle.sh/docs/mutators · for agents: llms.txt

Design shape

  • Port. The walker skeleton is ported from rindle-d2s (rust/rindle-d2s/, the SQLite AST→SELECT compiler that matches our exact Ast and shares complete_ordering with the engine's builder). The Postgres leaves and the ::text::<type> cast strategy are ported from mono's z2s. rindle-d2s stays the differential oracle (§9), never a runtime dep.
  • Two dialects, one product. postgres is the product target. sqlite exists only as the offline oracle: it lets the whole walker be proven end-to-end against Node's built-in node:sqlite with zero infrastructure. It is never wired to a product consumer.
  • Driver-free. Emits { sql, params } and imports no Postgres driver — the app's driver runs it through the plugger seam (Invariant 7).
  • The catalog (src/catalog.ts) carries column order, primary key, relationship cardinality, and per-column native type detail ({ type, isEnum, isArray }) for the cast switch. It is a pure input — the compiler never touches a database. Hand-authored for tests. Where it comes from in production for the Postgres dialect is not yet settled in code: designs/416-POSTGRES-READ-CATALOG-DESIGN.md specifies one published Rindle-owned row read over the mutator's open transaction, superseding §7's static artifact. Until that ships, tx.query on postgresBackend refuses rather than compiling against a stub — a stub catalog compiles cleanly and returns wrong rows.

Status

Both dialects compile. The sqlite dialect is wired and drives the daemon backend's session reads (packages/api-server/src/index.ts). The postgres dialect is not yet wired to a consumer: tx.query on postgresBackend refuses until design 416 supplies the column-type catalog (above).

Its SQL is pinned offline by golden tests (test/golden-pg.test.ts) and by the read-parity battery (test/parity-battery-pg.test.ts), which prove that every query in the battery lowers for Postgres and carries the ordering the engine implies. But the only dialect whose output is executed in tests is sqlite (the node:sqlite oracle, which is what proves the shared walker). Execution parity against a live Postgres is still owed.

Test

pnpm --filter @rindle/query-compiler test   # tsc --noEmit + node --test (node:sqlite oracle)