writeInto function

Future<bool> writeInto(
  1. List<Table> tables,
  2. String targetFile, {
  3. String? header,
  4. Map<String, String>? imports,
  5. bool targetCockroachDB = false,
  6. bool format = true,
})

Implementation

Future<bool> writeInto(
  List<Table> tables,
  String targetFile, {
  String? header,
  Map<String, String>? imports,
  bool targetCockroachDB = false,
  bool format = true,
}) async {
  return await writeIntoFile(tables, File(targetFile), (List<Table> items) {
    final src = generateSource(
      items,
      imports: imports,
      targetCockroachDB: targetCockroachDB,
    );
    return '${header ?? ''}$src';
  }, format);
}