forGenerator property

  1. @override
String get forGenerator
override

Outputs model as String to be used in a generator

Implementation

@override
String get forGenerator {
  final parts = [
    "'$name'",
    definitionType,
    "onTable: '$onTable'",
  ];

  if (defaultValue != null) {
    parts.add('defaultValue: $defaultValue');
  }

  if (autoincrement != defaults.autoincrement) {
    parts.add('autoincrement: $autoincrement');
  }

  if (nullable != defaults.nullable) {
    parts.add('nullable: $nullable');
  }

  if (unique != defaults.unique) {
    parts.add('unique: $unique');
  }

  return 'InsertColumn(${parts.join(', ')})';
}