Migra
Migra is a simple library for managing SQL in your application.
For example, if you have a task list application, you can update the local user database from version to version.
This is main crate for migra-cli, which allows you to manege SQL for web servers in any program language without being bound to SQL frameworks.
Installation
Add migra = { version = "1.0" } as a dependency in Cargo.toml.
This crate has not required predefined database clients in features with similar name.
If you want to add them, just install crate with additional features (postgres, mysql, sqlite).
Cargo.toml example:
[]
= "my-crate"
= "0.1.0"
= ["Me <user@rust-lang.org>"]
[]
= { = "1.0", = ["postgres"] }
Basic usage
Note: This example requires to enable sqlite feature.
use ;
use ;
Supported databases
| Database | Feature |
|---|---|
| Postgres | postgres |
| MySQL | mysql |
| Sqlite | sqlite |
License
Licensed under either of these:
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)