Who it is forA team that has shipped a renamed column to production because nothing checked the queries.
The problemSQL in strings or files is invisible to the type checker, so schema changes break at run time.
The outcomeA typecheck script that reports a misspelled column, a wrong parameter or a dropped table as a type error.
What you need first
- TypeScript 7.1 (currently in beta), the first release with content mappers
- Node 24 or later
- A running dev database: Postgres, MySQL 8.0.22 or later, or a SQLite file
- A supported driver such as pg, postgres.js, mysql2, better-sqlite3, Bun.sql or Cloudflare D1
Steps
- Add a typecheck script:
tsc --noEmit --runExternalCode, which lets tsc run content mappers - Point DATABASE_URL at a dev database that has your current schema
- Run the typecheck locally and in CI after every migration
- Set up your editor from the Reylo docs to see the same errors as you type
Prompt for your agent
In <project>, add a typecheck script that runs tsc with --noEmit --runExternalCode against the dev database in DATABASE_URL. Then rename <column> in a scratch migration and show me every .sql query and caller that now fails.
Caveat. --runExternalCode lets tsc execute content mapper code, and CI needs access to a database with the current schema.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for colinhacks/reylo and "Catch broken SQL in tsc before it ships"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer