#208208th of 358 in Backends, databases and hosting
reylo
Import .sql files into TypeScript with types inferred from your database
- Stars
- 1.8k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- Rust
64 on 21 Oct 20261,751 on 25 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
Reylo is a TypeScript 7.1 content mapper that lets you import .sql files and call them with `.run(db, params)`. It has a dev database prepare each query without running it, then derives column and parameter types, nullability, row cardinality and enum unions. It works with Postgres, MySQL, SQLite and ClickHouse (preview) through your own driver, with no generated files.
Who it is for: TypeScript developers who write raw SQL and want inferred types without codegen
Strengths
- Types come from the live dev schema, so a misspelled column is a type error
- No codegen step, generated files or watcher
- Works with many drivers: pg, postgres.js, mysql2, better-sqlite3, D1, Turso, Drizzle, Knex
- Plugins for Node, Bun, Vite, Next.js, esbuild, webpack and Cloudflare Workers
Weaknesses
- Requires TypeScript 7.1, which is still in beta
- Type-checking needs a running dev database and `tsc --runExternalCode`
- ClickHouse support is preview and needs version 25.11 or later
- Parameters need colon names and casts where the query does not fix a type
What it needs
- no GPU
- Needs Node 24+, TypeScript 7.1 (beta), Dev database: Postgres, MySQL 8.0.38+, ClickHouse 25.11+ (preview) or SQLite
What changed
- v0.9.0 ↗ (opens in a new tab)Breaking
“feat(spec)!: write enum values as objects by @colinhacks in https://github.com/reylosql/reylo/pull/420”
- v0.8.2 ↗ (opens in a new tab)Breaking
“feat(cli)!: name the file only when reylo analyze reads several by @colinhacks in https://github.com/reylosql/reylo/pull/350”
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Known problems
Reported, then fixed by a linked change
- migrate init fails on Postgres when the schema uses a `#` operator (`#>>`, `#>`, `#-`, `#`) ↗ (opens in a new tab)0 reactions · closed 24 Nov 2026Fixed by fix(migrate): lock init.sql as the checks read it back ↗ (opens in a new tab)
- migrate init fails on Postgres when a trigger WHEN or CHECK compares rows of 3+ columns ↗ (opens in a new tab)0 reactions · closed 24 Nov 2026Fixed by fix(migrate): compare postgres expressions as the server reads them back ↗ (opens in a new tab)
- migrate init fails on Postgres when a CHECK uses varchar_column IN (...) ↗ (opens in a new tab)0 reactions · closed 24 Nov 2026Fixed by fix(migrate): compare postgres expressions as the server reads them back ↗ (opens in a new tab)
Titles are the reporters' own words, taken from the project's GitHub issues and ranked by reactions. We have not tried to reproduce any of them.
Also in Backends, databases and hosting
See all 358| Rank | Project | Score |
|---|---|---|
| #206 | driftReactive SQLite persistence library for Flutter and Dart with generated type-safe queries | 68 out of 100 |
| #207 | remultTypeScript entity library that generates CRUD, realtime API and typed client | 68 out of 100 |
| #209 | arangodbMulti-model database for graphs, JSON documents and full-text search via AQL | 67 out of 100 |
| #210 | ubicloudOpen-source IaaS control plane for VMs, Postgres and Kubernetes on bare metal | 67 out of 100 |
| #211 | tortoise-ormAsync Python ORM with a Django-like API and built-in migrations | 67 out of 100 |