addTable method

void addTable(
  1. SchemaTable table
)

Adds a table to this instance.

Sets table's SchemaTable.schema to this instance.

Implementation

void addTable(SchemaTable table) {
  // ignore: unnecessary_null_comparison
  if (this[table.name!] != null) {
    throw SchemaException(
        "Table ${table.name} already exists and cannot be added.");
  }

  _tableStorage!.add(table);
  table.schema = this;
}