Column.fromJson constructor
Column.fromJson()
Implementation
factory Column.fromJson(
String colName,
Map<String, dynamic> json,
List<String> parentTableRequiredFields,
) {
return Column(
postgresFormat: json['format'],
dbColName: colName,
camelColName: snakeCasingToCamelCasing(colName),
enumValues:
json['enum'] != null ? List<String>.from(json['enum']) : <String>[],
hasDefaultValue: json['default'] != null,
description: json['description'],
maxLength: json['maxLength'],
isPrimaryKey: json['description']?.contains('<pk/>') ?? false,
isSerialType: json['description']?.contains('[supadart:serial]') ?? false,
isInRequiredColumn: parentTableRequiredFields.contains(colName),
);
}