Reylo infers type information from SQL queries, against a live database.
select u.id, u.name, count(p.id)::int as post_count from users u left join posts p on p.user_id = u.id where u.id = :id::int group by u.id
Parameters, columns, nullability, cardinality and nested JSON shapes, from your database's own analysis of each query.
select u.name, p.title from users u left join posts p on p.user_id = u.id where u.id = :user_id::int
{ user_id: number }
{ name: string; title: string | null }[]
A left join makes the joined table's columns nullable.
Any syntax, function or operator your database supports, from window functions to JSON aggregation and returning clauses.
Parameters, columns, nullability and cardinality come from the database's own analysis of each query.
A misspelled column is a type error at its line and column, and so is a wrong argument to .run().
A query and its types are one file. An agent edits the SQL, and the types follow, with nothing else to update.
Each in its own dialect, on Neon, Supabase, PlanetScale, Cloudflare D1, Turso and more.
Runs on pg, postgres.js, Bun.sql, Neon, mysql2, mariadb, PlanetScale, better-sqlite3, node:sqlite, libSQL, Cloudflare D1 and more, or through Drizzle and Knex.