Reshape Rust helper
This is a Rust helper library for the automated, zero-downtime schema migration tool Reshape. To achieve zero-downtime migrations, Reshape requires that your application runs a simple query when it opens a connection to the database to select the right schema. This library automates that process and provides a macro to embed the right query directly in your application.
Installation
Add reshape_helper
as a dependency to your Cargo.toml
:
[]
= "0.1.1"
Usage
The library exposes a single macro which will find all your Reshape migration files and determine the right schema query to run. The macro will be evaluated at compile time and the query embedded directly in your binary, so you won't need to keep your migration files around at runtime.
The following is an example of how to use the library together with SQLx (but it works with any Postgres client):
use schema_query
use PgPoolOptions;
async
By default, schema_query!
will look for migration files in migrations/
but you can specify your own directories as well:
use schema_query
License
Released under the MIT license.