Introducing Reylo Migrate!
29K followers
33,649 views
20 Comments
Comments from the original post on X (Twitter)

@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
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
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
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
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
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
Try it 👉
7 likes

@RyanMarganti
You told me to "stay tuned" and did not disappoint.
1 like

@JayCooperBell
you are cooking!
1 like

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

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

@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
i've got a PR up for it! landing in preview soon!
3 likes

@ghaidar0
Christmas came early!

@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.

@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

@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
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.

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

@_jgx_
Nice work Colin!