Skip navigation
Introducing Reylo Migrate!
0:00 / 2:08

Introducing Reylo Migrate!

475 likesDownloadOriginal post

33,649 views

Introducing Reylo Migrate! SQL-first schema modeling & migrations for Postgres, MySQL, and SQLite ⬢ Declarative schema in `schema.sql` ⬢ Views, checks, triggers, fns, RLS, and more ⬢ Dry runs & drift checks via shadow dbs ⬢ Strict migration order via reylo.lock (optional)

20 Comments

Comments from the original post on X (Twitter)

  • colinhacks's profile picture

    @colinhacks

    SCHEMA MODELING All schema is written declaratively in a schema.sql file. Using SQL for schema lets you model things not possible in lossy schema DSLs ✅ Checks ✅ Indexes ✅ Triggers ✅ Functions ✅ Views ✅ Extensions ✅ Computed columns ✅ RLS ✅ Domains

    7 likes

  • colinhacks's profile picture

    @colinhacks

    SCHEMALESS MODE Declarative schema is great but if you're happy with DDL you can keep it imperative. Just delete `schema.sql` and `reylo migrate new` generates an empty migration file you (or your agent) can populate Introspect the schema anytime with `reylo db introspect`

    2 likes

  • colinhacks's profile picture

    @colinhacks

    MIGRATION ORDERING By default Reylo enforces a strict migration order via `reylo.lock`. This makes things deterministic and causes git conflicts if multiple schema-modifying PRs land in parallel (desirable)

  • colinhacks's profile picture

    @colinhacks

    LOCKFREE INTEGRITY The lockfile may be too onerous for some fast-moving teams (too many PR conflicts) With Reylo, there's a simple fix: delete the lockfile. Even without it, Reylo detects and prevents any path-dependent schema drift

  • colinhacks's profile picture

    @colinhacks

    TYPICAL WORKFLOW 1/ Edit schema.sql 2/ Push it to your dev database with `db push` 3/ Generate a migration with `migrate new` when you're done iterating 4/ Apply it with `migrate dev` 5/ Merge branch into main 6/ Deploy to prod with `migrate deploy`

    2 likes

  • colinhacks's profile picture

    @colinhacks

    This migration tool completes the Reylo toolkit! Use the core Reylo engine for type safe querying, and Reylo Migrate for schema modeling and migrations. Get started with `reylo migrate init`

    1 like

  • colinhacks's profile picture

    @colinhacks

    Try it 👉

    7 likes

  • Ryan Marganti's profile picture

    @RyanMarganti

    You told me to "stay tuned" and did not disappoint.

    1 like

  • 🦋 jaycooperbell.dev's profile picture

    @JayCooperBell

    you are cooking!

    1 like

  • RonnieLi's profile picture

    @lhf0506

    @dillon_mulroy You just gave me the reason to try out Reylo, good stuff 👍

    1 like

  • François's profile picture

    @Linuske

    Hey @colinhacks! This is sweet, does Reylo migrate plan to support @CockroachDB?

  • Georges Haidar's profile picture

    @ghaidar0

    Hell yeah. Nice one Colin! Do you think it's realistic to point an agent at the repo and get a clickhouse dialect? It's the only piece keeping us stuck to Atlas.

  • colinhacks's profile picture

    @colinhacks

    i've got a PR up for it! landing in preview soon!

    3 likes

  • Georges Haidar's profile picture

    @ghaidar0

    Christmas came early!

  • Nyasha Dennis's profile picture

    @chirorojr

    Does it support multi file schemas i.e. putting schemas in a schema directory and having files like users.sql, tokens.sql, tasks.sql One giant file can get tedious.

  • Boardy's profile picture

    @boardyai

    for teams running postgres in production i know a founder whose platform sits on postgres streams. want an intro? dm's in your inbox

  • Mustafa Nevfel's profile picture

    @xmnevfel

    Rename versus drop plus add is a case where a schema diff has to guess. A dry run on the shadow db only exposes a wrong guess if that db holds rows, so seeded data there matters as much as the diff logic.

  • colinhacks's profile picture

    @colinhacks

    indeed. Reylo detects ambiguous schema modications and requires you to disambiguate. it also requires explicit `--drop` flags for any destructive operation when generating migrations. and after a migration file is generated you can edit it at will to handle data migrations. only when you apply it (`migrate dev`) is the hash written into the lockfile.

  • Bidek's profile picture

    @Bidek56

    Does it work with iceberg tables? No tools exist for iceberg yet. Thx

  • Julien Goux's profile picture

    @_jgx_

    Nice work Colin!