cd /news/developer-tools/show-hn-reylo-import-sql-files-into-… · home › topics › developer-tools › article
[ARTICLE · art-175685] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Show HN: Reylo – Import .sql files into TypeScript with full type inference

Colin, the creator of Zod, released Reylo, an open source project that imports .sql files into TypeScript with full type inference by using the Content Mapper API in TypeScript 7.1, currently in beta. Reylo supports Postgres, MySQL, and SQLite, and its inference engine is written in Rust, relying on prepared queries where possible and augmenting with its own AST; native JSON Schema CHECK constraints for each dialect, such as pg_jsonschema on Postgres, are reflected in return types. The project uses an internal "Reylo Type Defs" spec that can represent a superset of major RDBMS type systems, and Colin plans to add support for other languages, including a Rust/sqlx macro.

key takeaway

Reylo's TypeScript 7.1 Content Mapper loads .sql files and infers return types across Postgres, MySQL and SQLite, including JSON Schema CHECK constraints like pg_jsonschema.

read1 min views6 publishedNov 24, 2026

Colin here, mostly known for creating Zod.

Reylo is a new open source project I'm working on that takes advantage of the new Content Mapper API in TypeScript 7.1 (currently still in beta). Content mappers are sort of like plugins for TypeScript in that they let you define s for external file types. My mind went straight to .sql.

This started as an experiment, but it's turned into a serious engineering effort.

• Support for Postgres, MySQL, and SQLite

• The inference engine is written in Rust. It relies on prepared queries to the greatest extent possible but augments from there with its own AST.

• The major JSON schema extensions for each dialect are natively supported (e.g. pg_jsonschema on Postgres), so JSON Schema CHECK constraints are reflected in the return types

• Type information bubbles up through JSON aggregation

• We have our own internal type definition spec ("Reylo Type Defs") that's sort of like JSON Schema but it can represent a superset of the type systems in all major RDBMSs. Still just an internal representation, but there are a lot of fun ideas in it for anyone who's interested in that kind of design space.

• Planning to add support for other languages beyond TypeScript soon, including a macro for Rust/sqlx

Docs are here[0] or you can play around with the inference in-browser using the playground[1] (locally runs PGlite and Reylo's WASM build).

[0] [https://reylo.dev/docs](https://reylo.dev/docs)
[1] [https://reylo.dev/play](https://reylo.dev/play)

Comments URL: [https://news.ycombinator.com/item?id=50634246](https://news.ycombinator.com/item?id=50634246)

Points: 1

── more in #developer-tools 4 stories · sorted by recency
── more on @colin 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-reylo-import…] indexed:0 read:1min 2026-11-24 · —