PowerSyncDatabase.withDatabase constructor

PowerSyncDatabase.withDatabase({
  1. required Schema schema,
  2. required SqliteDatabase database,
  3. Logger? loggers,
})

Open a PowerSyncDatabase on an existing SqliteDatabase.

Migrations are run on the database when this constructor is called.

logger defaults to autoLogger, which logs to the console in debug builds.

Implementation

factory PowerSyncDatabase.withDatabase(
    {required Schema schema,
    required SqliteDatabase database,
    Logger? loggers}) {
  return PowerSyncDatabaseImpl.withDatabase(
      schema: schema, database: database);
}