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

@razsdev/datasieve-query-language

v0.1.0

Published

DSQL — the database-agnostic query language at the core of DataSieve.

Readme

@razsdev/datasieve-query-language

DSQL — the DataSieve Query Language. The public, database-agnostic language every DataSieve application writes and every adapter consumes.

This package implements only the language: types, operator definitions, and skeleton parse/normalize/validate functions. It has no adapters, no execution, no Prisma/SQL/Mongo/Elasticsearch knowledge whatsoever — see CLAUDE.md at the repo root for the full architectural context.

Concepts

DSQL describes what data is wanted, never how to retrieve it, and is philosophically inspired by Odoo Domains: declarative, nestable filter trees over field paths — modernized as inferred TypeScript rather than Odoo's own syntax.

  • DataSieveQuery<T> — the root, public type. Every field is optional. Given a plain TypeScript type T for your resource, DSQL infers valid field paths, operators, and value types entirely from T's shape.
  • WhereInput<T> / Condition<T> — the filter tree: and/or/not nested to unbounded depth around leaf conditions ({ field, op, value }). field autocompletes over every dot-notation path on T (including through nested objects and arrays); op is narrowed to what's valid for that field's type; value's shape follows op.
  • SearchInput<T> — free-text search, independent from where.
  • SortInput<T>, PaginationInput (offset or cursor), SelectInput<T>, IncludeInput<T>, GroupByInput<T>, AggregationInput<T> — the rest of the query surface.
  • QueryAST — the internal, string-keyed normalized representation adapters actually consume. normalizeQuery is the one-way bridge from the typed public API to this AST; see ast/query-ast.ts for why the two are deliberately different shapes.

Pipeline

raw input --parseQuery--> DataSieveQuery<T> --validateQuery--> DataSieveQuery<T> --normalizeQuery--> QueryAST

parseQuery and validateQuery are intentionally skeletons: they check gross shape and structural consistency, not that a field path exists on T or that a value's runtime type is correct (schema-aware validation is a separate, future plugin per CLAUDE.md). normalizeQuery is fully implemented for every current feature.

Examples

See examples/query-language/ at the repo root for one file per major feature (filtering, logical nesting, nested field paths, search, sort, offset/cursor pagination, select/include, grouping/aggregation, and a fully composed query).

Extending

  • New operator: src/operators/operator-types.ts (type rules) + src/operators/operators.ts (runtime metadata). See that file's header comment for the exact steps.
  • New AST node / query feature: add the public type, add the matching AST node in src/ast/nodes.ts, wire it into QueryAST and normalizeQuery.