barrel 0.2.7

A powerful schema migration building API for Rust
docs.rs failed to build barrel-0.2.7
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: barrel-0.7.0

A powerful schema migration builder for Rust. Write complicated SQL schema migrations in Rust and easily switch databases.

barrel is meant to make writing migrations for different databases as easy as possible. It creates a simple to use API over SQL which allows you to focus on managing your database, not fighting with SQL.

Example

barrel now works with the stable compiler. The following code is a simple example of how to get started

extern crate barrel;

use barrel::*;
use barrel::backend::Pg;

fn main() {
    let mut m = Migration::new();
    m.create_table("users", |t| {
        t.add_column("name", Type::Text);
        t.add_column("age", Type::Integer);
        t.add_column("owns_plushy_sharks", Type::Boolean);
    });

    println!("{}", m.make::<Pg>());
}

If you have feedback regarding the API or things you would want barrel to do, please open an issue. And documentation PR's are always welcome 💚

Using Diesel

Since diesel 1.2.0 it's possible to now use barrel for migrations with diesel. A guide with some more information on how to get started can be found here

Unstable features

Starting with v0.2.4 barrel now has an unstable feature flag which will hide features and breaking changes that are in-development at the time of a minor or patch release. You can use these features if you so desire, but be aware that their usage will change more rapidely between versions (even patches) and their usage will be badly documented.

License

barrel is free software: you can redistribute it and/or modify it under the terms of the MIT Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT Public License for more details.

Conduct

In the interest of fostering an open and welcoming environment, the barrel project pledges to making participation a harassment-free experience for everyone. See Code of Conduct for details. In case of violations, e-mail kookie@spacekookie.de.