updateSchema method

Future<void> updateSchema(
  1. Schema schema
)
inherited

Replace the schema with a new version. This is for advanced use cases - typically the schema should just be specified once in the constructor.

Cannot be used while connected - this should only be called before connect.

Implementation

Future<void> updateSchema(Schema schema) async {
  schema.validate();

  await _activeGroup.syncConnectMutex.lock(() async {
    _connections.checkNotConnected();

    this.schema = schema;
    await database.writeLock((tx) => schema_logic.updateSchema(tx, schema));
  });
}