JsonTable constructor
JsonTable(})
A table name keyed by key, with indexes over the named fields and
uniqueIndexes (each index is named after its fields), synchronized
with the remote syncWith when given.
Implementation
JsonTable(
String name, {
String key = 'id',
bool autoIncrementKey = false,
List<List<String>> indexes = const [],
List<List<String>> uniqueIndexes = const [],
String? syncWith,
}) : _table = DbTable<JsonRow>(
name,
key: key,
fromJson: JsonRow.new,
toJson: (row) => row.json,
autoIncrement: autoIncrementKey,
indexes: [
for (final fields in indexes) Index(fields),
for (final fields in uniqueIndexes) Index.unique(fields),
],
syncWith: syncWith,
);