22 releases

0.8.14 Apr 3, 2024
0.8.13 Mar 29, 2024
0.8.12 Jan 22, 2024
0.8.11 Sep 13, 2023
0.1.0 Dec 8, 2019

#1402 in Command line utilities

Download history 258/week @ 2024-02-21 371/week @ 2024-02-28 119/week @ 2024-03-06 206/week @ 2024-03-13 160/week @ 2024-03-20 513/week @ 2024-03-27 435/week @ 2024-04-03 267/week @ 2024-04-10 231/week @ 2024-04-17 243/week @ 2024-04-24 329/week @ 2024-05-01 266/week @ 2024-05-08 185/week @ 2024-05-15 194/week @ 2024-05-22 138/week @ 2024-05-29 155/week @ 2024-06-05

717 downloads per month


2.5K SLoC

Refinery Cli

Run Refinery migrations via cli.


The binary name for refinery_cli is refinery.

Archives of precompiled binaries for refinery are available for Windows, macOS and Linux. Linux and Windows binaries are static executables. Users of platforms not explicitly mentioned below are advised to download one of these archives.


If you're a Debian user (or a user of a Debian derivative like Ubuntu), then refinery can be installed using a binary .deb file provided in each refinery_cli release.

$ curl -LO https://github.com/rust-db/refinery/releases/download/0.8.4/refinery_0.8.4_amd64.deb
$ sudo dpkg -i refinery_0.8.4_amd64.deb

Arch Linux

If you're an Arch Linux user, then you can install the refinery_cli package from AUR:

$ yay refinery_cli


If you're a Nix user, you can install refinery via the refinery-cli package:

$ nix-env -iA refinery-cli


If you're a Rust programmer, refinery_cli can be installed with cargo.

$ cargo install refinery_cli


Setup your database type and access credentials with setup.

$ refinery setup

After that, just run your migrations giving your config file with -c flag (by defaults it is the refinery.toml generated by the setup) and migrations dir with files -p $dir.

$ refinery migrate -c sqlite_refinery.toml -p ./sql_migrations

Running via database uri

To run migrations from a database uri (like: postgres://user_name:passwd@hostname:5432/myDB ) stored in an environment variable DB_URI.

$ refinery migrate -e DB_URI -p ./sql_migrations

This option is also useful when running refinery inside a docker container, where you usually have the db connection info stored as an environment variable.

For more info and migration options run.

$ refinery migrate --help


~418K SLoC