
reylo
Import .sql files into TypeScript with full type inference and zero codegen.
The Lens
By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.
Updated Oct 2026
Reylo lets you write plain SQL in .sql files and import them straight into TypeScript, with the result types worked out for you. Call .run(db, { id: 1 }) and your editor knows the row shape, which columns can be null, and whether you get one row or a list. No ORM, no generated files. It comes from Colin McDonnell, the author of Zod. MIT, free.
Setup is where it gets early. You need TypeScript 7.1, still in beta, Node 24, and a running dev database (Postgres, MySQL or SQLite), because Reylo asks the database to prepare each query and reads the types back. Type checks run as tsc --noEmit --runExternalCode, so CI needs a database too. It works with pg, postgres.js, mysql2, better-sqlite3, Bun.sql or Drizzle. Nothing is paid. Solo and small teams: free, try it on a side project. Larger teams: wait for TypeScript 7.1 stable.
The catch: the public repo is about a week old, on version 0.6.0, which already changed what some queries return. Expect breaking changes. The README also lists DuckDB, but the DuckDB engine on npm is still a placeholder. For something proven today, PgTyped and SafeQL do similar jobs on stable TypeScript.
Free vs Self-Hosted vs Paid
fully freeFree: Everything. The reylo package and the per-database engines (@reylosql/postgres, @reylosql/mysql, @reylosql/sqlite) are MIT-licensed on npm, published by the author.
Self-hosted: Nothing to host; it's a dev dependency plus a runtime loader. Requirements: TypeScript 7.1 (beta, installed as typescript@beta), Node 24 or later, and a reachable dev database (Postgres, MySQL 8.0.22 or later, or a SQLite file) at type-check time. Runtime plugins exist for Node, Bun, Vite, Next.js, esbuild, webpack, Rspack, Cloudflare Workers and Jest. Editors need a trusted workspace because content mappers run code.
Paid: There is no paid tier, hosted service or sponsorship gate. Your database hosting is your own cost.
Free with nothing gated. The cost is adopting a 0.x library that depends on a beta TypeScript compiler.
What to do by team size
- Solo
- free; worth trying on a side project
- Small team
- free, if you're fine on the TypeScript 7.1 beta
- Medium team
- free, but wait for TypeScript 7.1 stable and a 1.0
- Large team
- free; wait for 1.0, or use PgTyped or SafeQL today
Get tools like this every Wednesday
One featured tool, three on the radar. No fluff.
A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores
Trust Signals
About
- Owner
- Colin McDonnell (User)
- Stars
- 1,521
- Forks
- 18
Also by Colin McDonnell
Explore Further
More tools in the directory
rea
Reverse engineer anything with agents, from app behavior down to native binaries.
435.8k ★openclaw
Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
394.0k ★everything-claude-code
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
298.1k ★