talira

Import .sql files into TypeScript with types inferred from your live database, plus SQL-first migrations

open sourceMITfree

A type inference engine for SQL. You write queries in plain .sql files and import them into TypeScript; Reylo has your Postgres, MySQL or SQLite database prepare each statement without running it and hands TypeScript the types of its parameters and rows, through the content mapper API that TypeScript 7.1 added, so there is no code generation step. Reylo Migrate models the schema in a schema.sql file and generates or applies migrations from it. MIT licensed, from Variadic.

Problems it solves

  • write raw SQL in my TypeScript app and still get typed results without an ORM
  • keep my database schema in one SQL file and generate migrations from it
  • stop hand-writing TypeScript types for my SQL queries

Features

  • import .sql files into TypeScript with inferred parameter and row types
  • types come from the live database's own analysis of each query
  • Postgres, MySQL and SQLite
  • schema modeled in schema.sql, with generated or hand-written migrations (Reylo Migrate)
  • deploy guides for Neon, Supabase, PlanetScale, Cloudflare D1 and Turso

Alternatives

The same job

These do what Reylo does.

  1. Kysely Type-safe SQL query builder for TypeScript
  2. Knex.js SQL query builder for Node.js with migrations and seeds

Compare Reylo with the top 3