wandel 2.0.3 wandel: ^2.0.3 copied to clipboard
Wandel is a data migration library. Out of the box with mysql-connector based on sqljocky5.
wandel #
The wandel lib is a migration lib for dart. The tool itself is not specifically related to databases but basically provides a clean API for running and rolling back tasks. It brings out of the box an MySqlConnector based on sqljocky5.
Installation #
Add it to your dependencies
dependencies:
wandel: "^2.0.0"
and install the package
$ pub get
Usage #
Take a look into the example folder.
pub run example/basic/basic.dart
import 'package:wandel/wandel.dart';
import 'migrations/2018-01-18-task1.dart';
import 'migrations/2018-01-18-task2.dart';
import 'migrations/2018-01-18-task3.dart';
main() async {
List<WandelMigration> migrations = [
new MyWandelMigration1(),
new MyWandelMigration2(),
new MyWandelMigration3()
];
Wandel wandel = new Wandel(
migrations: migrations,
connector: new WandelMySQLConnector(
tableName : '__migration',
user : 'username',
password : 'password',
database : 'databasename',
host : 'localhost',
port : 3306,
maxConnections : 5
)
);
wandel.execute(mode: WANDEL_MODE.UP).then((List<WandelMigration> touchedList) {
print(touchedList);
print('finished');
});
}
Contributing #
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Credits #
Robert Beyer 4sternrb@googlemail.com
License #
MIT