Table constructor

Table({
  1. required String name,
  2. required List<TableColumn> resolvedColumns,
  3. bool withoutRowId = false,
  4. bool isStrict = false,
  5. List<TableConstraint> tableConstraints = const [],
  6. TableInducingStatement? definition,
  7. bool isVirtual = false,
})

Constructs a table from the known name and resolvedColumns.

Implementation

Table({
  required this.name,
  required this.resolvedColumns,
  this.withoutRowId = false,
  this.isStrict = false,
  this.tableConstraints = const [],
  this.definition,
  this.isVirtual = false,
}) {
  for (final column in resolvedColumns) {
    column.table = this;

    if (_rowIdColumn == null) {
      if (column is RowId) {
        _rowIdColumn = column;
      } else if (column.isAliasForRowId()) {
        _rowIdColumn = column;
        // By design, the rowid is non-nullable, even if there isn't a NOT NULL
        // constraint set on the column definition.
        column._type =
            const ResolvedType(type: BasicType.int, nullable: false);
      }
    }
  }
}