What do you want to do?
3 use cases
-
Import .sql files into TypeScript with real types
Write queries in .sql files, import them, and get row and parameter types from your database.
View prompt
Add colinhacks/reylo to <project> using <database> and <driver>. Move the query in <file> into a .sql file, import it, and show me the inferred return type. Use TypeScript 7.1 beta and keep the existing behavior identical.
-
Catch broken SQL in tsc before it ships
Type-check SQL against your dev database so a dropped table or misspelled column fails the build.
- REPO
colinhacks/reylo - Software and DevOps
- Intermediate
View prompt
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.
- REPO
-
Let coding agents edit SQL without leaving stale types
Keep each query in one .sql file so an agent cannot leave an old type behind, and let tsc find every caller.
View prompt
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.
Quick start with Reylo
- Check you have what it needs: 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.
- Open colinhacks/reylo on GitHub and read the README and license.
- Install:
npm install reylo, thennpm install -D @reylosql/postgres(or mysql or sqlite) andnpm install -D typescript@beta - Add a contentMappers entry for Reylo to tsconfig.json covering .sql, .reylo.yaml and .reylo.yml
- Set DATABASE_URL in your environment or .env; its scheme tells Reylo which database you use
- Write a query in a .sql file with named parameters such as :id::int, import it and call
.run(db, { id: 1 })with your driver's client
These steps come from our top use case, Import .sql files into TypeScript with real types, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for colinhacks/reylo
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 freeAbout this repo
- Who it is forTypeScript developers who prefer raw SQL to an ORM, and teams whose coding agents write queries.
- Why it is hot1.2k stars, launched 5 days ago, talked about in 2 AI sources we track
- LanguageRust
- Sourcegithub.com/colinhacks/reylo · Back to Hot repos
Requirements
- 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
Add this badge to your README
Maintain Reylo? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/colinhacks-reylo/?utm_source=github&utm_medium=badge&utm_campaign=colinhacks-reylo)
HTML
<a href="https://dedupedai.com/use-cases/colinhacks-reylo/?utm_source=github&utm_medium=badge&utm_campaign=colinhacks-reylo"><img src="https://dedupedai.com/badge/colinhacks/reylo.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Reylo
What is Reylo?
Reylo, from Zod author Colin McDonnell, lets you import .sql files straight into TypeScript with full type inference and no codegen. It uses TypeScript 7.1 content mappers to have your dev database prepare each query and read back column and parameter types, so a misspelled column or wrong parameter becomes a type error in tsc and your editor. It supports Postgres, MySQL and SQLite with your own driver. It is an open-source project on GitHub: https://github.com/colinhacks/reylo.
How do I use Reylo?
Install: npm install reylo, then npm install -D @reylosql/postgres (or mysql or sqlite) and npm install -D typescript@beta; then add a contentMappers entry for Reylo to tsconfig.json covering .sql, .reylo.yaml and .reylo.yml; set DATABASE_URL in your environment or .env; its scheme tells Reylo which database you use. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Reylo for?
TypeScript developers who prefer raw SQL to an ORM, and teams whose coding agents write queries.
What can I do with Reylo?
3 use cases so far, for example: Import .sql files into TypeScript with real types; Catch broken SQL in tsc before it ships; Let coding agents edit SQL without leaving stale types. Each has steps and a copy-paste agent prompt.
What do I need to run Reylo?
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.
What are alternatives to Reylo?
Other hot AI repos in Software and DevOps: Deep Infer, Harness2, Orca, Opencode, Graphify.
Is Reylo safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.