Table<KeyType> constructor

Table<KeyType>({
  1. required List<Column> columns,
  2. required String name,
  3. List<Join> childJoins = const [],
  4. List<String> groupProperties = const [],
  5. String additionalSql = "",
  6. bool withoutRowId = false,
})

Implementation

Table({
  required this.columns,
  required this.name,
  this.childJoins = const [],
  this.groupProperties = const [],
  this.additionalSql = "",
  this.withoutRowId = false,
}) : primaryKey = columns.whereType<IntoPrimaryKey>().firstOrNull?.toKey() ?? RowIdKey() {
  switch (primaryKey) {
    case SingleColumnKey primaryKey:
      assert(columns.contains(primaryKey.column), 'Single Primary key must be subset of columns');
      break;
    default:
  }
}