create method

Future<void> create(
  1. DatabaseSchemaEntity entity
)

Creates the given entity, which can be a table, a view, a trigger, an index or an OnCreateQuery.

Implementation

Future<void> create(DatabaseSchemaEntity entity) async {
  if (entity is TableInfo) {
    await createTable(entity);
  } else if (entity is Trigger) {
    await createTrigger(entity);
  } else if (entity is Index) {
    await createIndex(entity);
  } else if (entity is OnCreateQuery) {
    await _issueQueryByDialect(entity.sqlByDialect);
  } else if (entity is ViewInfo) {
    await createView(entity);
  } else {
    throw ArgumentError('Unknown entity type: $entity');
  }
}