forGenerator property

  1. @override
String get forGenerator

Generated Dart code to include in a schema.

Implementation

@override
String get forGenerator {
  final columnsStringified = columns.map((c) => c.forGenerator).join(',\n\t\t');
  final indicesStringified = indices.map((c) => c.forGenerator).join(',\n\t\t');
  final printedIndices = indices.isNotEmpty ? '\t\t$indicesStringified' : '';
  return '''SchemaTable(
\t'$name',
\tcolumns: <SchemaColumn>{
\t\t$columnsStringified
\t},
\tindices: <SchemaIndex>{
$printedIndices
\t}
)''';
}