run static method
Creates a SchemaExporter with the database
, parses the single-argument
args
list as a dialect name, calls collectOnCreateStatements and sends
the resulting list over the port
.
This sequence is used by the drift_dev schema export
command, which
prints CREATE
statements making up a drift database analyzed from
source. For this to work, it emulates a drift build and then creates a
Dart program calling this method.
This method is thus internal to that utility and likely not useful outside of that.
Implementation
static Future<void> run(
List<String> args,
SendPort port,
GeneratedDatabase Function(QueryExecutor) database,
) async {
final export = SchemaExporter(database);
final statements = await export
.collectOnCreateStatements(SqlDialect.values.byName(args.single));
port.send(statements);
}