Data & Storage ยท zero-dependency ยท MIT

larzmigrate

Schema migrations, any backend.

Up/down schema migrations with checksum drift detection, over any DB-API database or the larzdb key-value backend. Rollback support and a clear status view.

larzscript pkg install migrate
View on GitHub →Learn the stack

What you get

Try it

import "migrate" as migrate
let r = migrate.new(nil)
let log = []
migrate.add(r, "001_users", "abc123", fn(ctx) { log.push("up 001") }, fn(ctx) { log.push("down 001") })
migrate.add(r, "002_posts", "def456", fn(ctx) { log.push("up 002") }, fn(ctx) { log.push("down 002") })
print(migrate.up(r, nil))
print(log)
print(migrate.status(r))
Output
[001_users, 002_posts]
[up 001, up 002]
[{name: 001_users, state: applied}, {name: 002_posts, state: applied}]

Why it's in the Larz Stack

larzmigrate is a real Larzscript package (larzscript pkg install migrate) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.