Rado GitHub

Rado documentation

Welcome. Rado is a fully typed, lightweight TypeScript query builder for SQLite, PostgreSQL and MySQL. These docs walk you through everything from your first select to recursive CTEs and auto-migrations.

If you're in a hurry, start with Getting started. If you're coming from Drizzle ORM, jump straight to Coming from Drizzle. Most query-building patterns carry over.

Table of contents

Start here

Defining your schema

Querying

Running queries

Background

Conventions used in these docs

Unless noted otherwise, examples assume a connected database instance named db and tables defined like this:

import {table} from 'rado'
import {boolean, id, integer, text} from 'rado/universal'

const User = table('user', {
  id: id(),
  name: text().notNull(),
  email: text()
})

const Post = table('post', {
  id: id(),
  authorId: integer().notNull(),
  title: text().notNull(),
  published: boolean().default(false)
})

Most examples run identically on SQLite, PostgreSQL and MySQL. Where a feature is dialect-specific (say, ilike or materialized views) the page says so.