sql-linter
v0.1.2
Published
SQL type-checker
Readme
sql-linter
A CLI that type-checks SQL queries in TypeScript source files by connecting to a live PostgreSQL database. It finds sql\...`` tagged template expressions and validates query parameters and return types against your TypeScript types.
Install
npm install
npm run build
npm linkUsage
sql-linter <dir> [--db <connection-url>]<dir>— directory to scan for TypeScript files--db— PostgreSQL connection URL (default:postgres://postgres:postgres@localhost:5432/postgres)
Example
sql-linter ./src --db postgres://user:pass@localhost:5432/mydbThe linter exits with code 1 if any errors are found, 0 otherwise.
