Who it is forA developer whose agent changes a query but forgets to update the matching TypeScript type.
The problemWhen types live apart from queries, agents fix one and leave the other stale.
The outcomeAgent edits that are checked end to end: change the SQL, and the type check flags every caller it missed.
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
- Set up Reylo as in its README so queries live in .sql files and types come from the SQL itself
- Point your agent at the docs as Markdown at Reylo.dev/llms.txt
- Ask the agent to change a query and then run the typecheck script
- Have it fix every caller the type check reports before it calls the task done
Prompt for your agent
Read reylo.dev/llms.txt, then in <project> change <query>.sql to <change>. Run the typecheck with --runExternalCode and fix every caller it reports. Do not hand-write any row types.
Caveat. The agent still needs access to the dev database for the type check to mean anything.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for colinhacks/reylo and "Let coding agents edit SQL without leaving stale types"
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