1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*!
Powerful SQL migration toolkit for Rust.
TODO - Work in progress... DO NOT USE IN PRODUCTION - COME BACK IN 2025 JANUARY.
`dbmigrator` makes running migrations for different databases as easy as possible.
It works by running your migrations on a provided database connection, either by embedding them on your Rust code, or via `dbmigrator_cli`.\
Currently, [`Postgres`](https://crates.io/crates/postgres), are supported.\
Planned [`Mysql`](https://crates.io/crates/mysql).\
`dbmigrator` works with .sql file migrations.
## Usage
- Migrations can be defined in .sql files.
- Migrations must be named in the format `{1}_{2}.sql` where `{1}` represents the migration version, `{2}` migration kind (upgrade, baseline, revert or fixup) and name.
- Migrations can be run either by embedding them on your Rust code with [`embed_migrations!`] macro (TODO), or via `dbmigrator_cli`.
[`embed_migrations!`]: macro.embed_migrations.html
### Example
```rust,ignore
use rusqlite::Connection;
mod embedded {
use dbmigrator::embed_migrations;
embed_migrations!("./tests/sql_migrations");
}
let mut conn = Connection::open_in_memory().unwrap();
embedded::migrations::runner().run(&mut conn).unwrap();
```
for more examples refer to the [examples](https://github.com/dbmigrator/dbmigrator/tree/master/examples)
*/
pub use Changelog;
pub use ;
pub use Config;
pub use Migrator;
pub use MigratorError;
pub use find_sql_files;
pub use load_sql_recipes;
pub use RecipeError;
pub use RecipeKind;
pub use RecipeScript;
pub use SIMPLE_FILENAME_PATTERN;
pub use ;