Rove is a fast, no-fluff migration manager for PostgreSQL built with Bun and TypeScript. It’s built for devs who just want to write raw SQL, version it in folders, and run it with confidence.
No ORMs. No DSLs. Just SQL.
Install
Install it using Homebrew:
brew install wess/packages/rove
Or clone it and run directly with Bun:
bun install
bun run rove migrate
How It Works
Migrations live in a migrations/
folder. Each migration is a directory with an incrementing number prefix and two files: up.sql
and down.sql
.
migrations/
├── 001_create_users/
│ ├── up.sql
│ └── down.sql
├── 002_add_index/
│ ├── up.sql
│ └── down.sql
To run migrations:
rove migrate
To roll back the most recent one:
rove rollback
Rove tracks what's been applied in a migrations
table in your database. It uses the DATABASE_URL
(or POSTGRES_URL
) environment variable to connect.
Commands
Here’s the full list of supported commands:
rove init # Initialize the migrations/ folder
rove new <name> # Generate a new numbered migration
rove create # Create the database
rove drop # Drop the database
rove up # Create DB if needed + run pending migrations
rove migrate # Run any pending migrations
rove rollback # Roll back the most recent migration
rove down # Alias for rollback
rove status # Show which migrations have been applied
rove dump [file] # Dump current schema (default: schema.sql)
rove load [file] # Load schema from file (default: schema.sql)
You can also run:
rove --help
to get usage info at any time.
Why Rove?
Most migration tools make you jump through hoops, invent YAML-based formats, or force you into their ORM. Rove does exactly one thing: it runs your SQL migrations.
- ✅ Built with Bun for speed
- ✅ Uses raw SQL, no wrappers
- ✅ Fast and scriptable for CI/CD
- ✅ Easy to version-control
- ✅ No global state or weird config files
Whether you're starting fresh or just want something small and sharp to replace heavier tools, Rove is a solid fit.
Getting Started
rove init
rove new create_users
# edit up.sql / down.sql
rove migrate
Need to reset the database?
rove drop && rove create && rove migrate
Want to snapshot the current schema?
rove dump
Final Thoughts
If you want your migrations to be transparent, versionable, and fast, Rove delivers. Built for Bun but works with anything that talks to PostgreSQL.
👉 github.com/wess/rove
Feedback, issues, and contributions always welcome.
Tidak ada komentar:
Posting Komentar