TableDefinition.fromJson constructor

TableDefinition.fromJson(
  1. Map<String, dynamic> jsonSerialization
)

Implementation

factory TableDefinition.fromJson(Map<String, dynamic> jsonSerialization) {
  return TableDefinition(
    name: jsonSerialization['name'] as String,
    dartName: jsonSerialization['dartName'] as String?,
    module: jsonSerialization['module'] as String?,
    schema: jsonSerialization['schema'] as String,
    tableSpace: jsonSerialization['tableSpace'] as String?,
    columns: (jsonSerialization['columns'] as List)
        .map(
            (e) => _i2.ColumnDefinition.fromJson((e as Map<String, dynamic>)))
        .toList(),
    foreignKeys: (jsonSerialization['foreignKeys'] as List)
        .map((e) =>
            _i2.ForeignKeyDefinition.fromJson((e as Map<String, dynamic>)))
        .toList(),
    indexes: (jsonSerialization['indexes'] as List)
        .map((e) => _i2.IndexDefinition.fromJson((e as Map<String, dynamic>)))
        .toList(),
    managed: jsonSerialization['managed'] as bool?,
  );
}