Run it once
No install needed with npx.
npx sqlsift-cli check --schema schema.sql query.sql
sqlsift checks queries against your schema files for unknown tables and columns, typos and type mismatches, with no database connection. This playground runs entirely in your browser via WebAssembly; your SQL never leaves the page.
The same checks run from the command line, in CI, and in your editor. Point sqlsift at your schema (migrations, schema.sql, a pg_dump…) and the queries you want to validate.
No install needed with npx.
npx sqlsift-cli check --schema schema.sql query.sql
From npm, or from source with Cargo. In an existing project, sqlsift init finds the schema and queries and writes a sqlsift.toml.
npm install -g sqlsift-cli
# or
cargo install --git https://github.com/yukikotani231/sqlsift sqlsift-cli
sqlsift init
sqlsift check
Fail pull requests that reference columns that do not exist, with annotations on the diff. diff-base reports only what the pull request introduces.
# .github/workflows/sqlsift.yml
name: SQL Lint
on: [push, pull_request]
jobs:
sqlsift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: yukikotani231/sqlsift@main
with:
schema-dir: db/migrations
files: queries/**/*.sql
diff-base: ${{ github.base_ref }}
Configure defaults with a sqlsift.toml, silence a line with -- sqlsift:disable E0002, or get live diagnostics in VS Code. See the user guide and the example projects for sqlc, Prisma, postgres.js, sqlx, MySQL and dbt.