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

@clv.wp/sastql

v0.2.1

Published

Static analyzer (SAST) for SQL files targeting PostgreSQL and SQLite.

Downloads

389

Readme

SastQL

Static analysis (SAST) for SQL files, targeting PostgreSQL and SQLite.

SastQL parses your SQL into a real AST (sqlparser-rs) — not regex on strings — and flags dangerous or non-portable patterns before they reach your database. 25 rules: DELETE/UPDATE without WHERE, cartesian JOIN without ON, SELECT *, CASE without ELSE, the NOT IN NULL trap, = NULL comparisons, md5(), ORDER BY random(), money stored in floats, tables without PRIMARY KEY, dialect-incompatible functions, and more.

Try it in one line

npx "@clv.wp/sastql" check migrations/ --dialect postgres

Every row of output is a violation; exit code 1 if any, 0 if clean, 2 on parse error — CI-ready. pnpm dlx and bunx work the same.

The quotes matter in PowerShell (@clv.wp collides with its @ splatting operator); harmless in cmd, Git Bash and sh — copy-paste as-is.

Install

npm install --save-dev "@clv.wp/sastql"

This adds the unscoped sastql binary to node_modules/.bin (prebuilt binaries for Windows x64, Linux x64/arm64 glibc & musl, macOS x64/arm64 — npm installs only the one matching your machine).

Usage

sastql check migrations/ --dialect postgres
sastql check schema.sql --dialect sqlite --format json
sastql check queries/ --rules select-star,no-where-on-mutation
sastql check dumps/ --rules missing-limit,destructive-ddl

--rules also unlocks the opt-in rules (missing-limit, union-without-all, order-by-ordinal, naive-timestamp, limit-without-order-by, destructive-ddl).

Rule-by-dialect matrix: docs/UML.md.

License

Source-available, deliberately not open source — © 2026 Clément Viellard, all rights reserved. Free for personal, educational and research use. Any commercial use requires the author's prior written permission. No redistribution or published derivative works without permission. See the LICENSE file shipped in this package and LICENSE.fr (authoritative).