Tools/colinhacks/reylo

reylo

Import .sql files into TypeScript with full type inference and zero codegen.

1.5k ★+111/wkemergingRustMIT License →new this week

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 free

Free: 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
Self-hosting ops:trivial

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Score
71/100 · B+
Adoption12/30
Maintenance25/25
Community9/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

Notable author: 4,142 followersAuthor also built: colinhacks/motherload (209 stars)

About

Owner
Colin McDonnell (User)
Stars
1,521
Forks
18

Also by Colin McDonnell

Explore Further

More tools in the directory