migrate_cli library Generate and automate

Migration commands for a project-owned Dart executable.

Pass a statically imported history to runMigrationCli. Database commands obtain their connection from MigrationConnection; inspection requests a read-only connection where the selected database supports it.

Functions

runMigrationCli(List<String> arguments, {required MigrationHistory history, required String directory, SchemaSnapshot? schema, MigrationConnection? connect, SchemaRenames renames = const SchemaRenames(), Map<String, Map<String, String>> using = const {}, bool json = true}) Future<void>
Runs commands against a project's statically imported migration history.

Typedefs

MigrationConnection = FutureOr<SqlDatabase<Backend>> Function({required bool readOnly})
Opens a runtime owned and closed by one migration CLI invocation.