MFieldVarchar constructor

MFieldVarchar({
  1. required String name,
  2. bool isPrimaryKey = false,
  3. bool isAutoIncrement = false,
  4. bool isNullable = false,
  5. String defaultValue = '',
  6. String? comment,
  7. List<ValidatorEvent> validators = const [],
  8. int length = 255,
})

Creates a VARCHAR field.

length specifies the maximum character length (default: 255, max: 65535)

Implementation

MFieldVarchar({
  required super.name,
  super.isPrimaryKey = false,
  super.isAutoIncrement = false,
  super.isNullable = false,
  super.defaultValue = '',
  super.comment,
  super.validators = const [],
  int length = 255,
}) {
  super.type = FieldTypes.VARCHAR;
  _options = '(${length.toString()})';
}