SqliteDatabase.withFactory constructor

SqliteDatabase.withFactory(
  1. AbstractDefaultSqliteOpenFactory<CommonDatabase> openFactory, {
  2. int maxReaders = SqliteDatabase.defaultMaxReaders,
})

Advanced: Open a database with a specified factory.

The factory is used to open each database connection in background isolates.

Use when control is required over the opening process. Examples include:

  1. Specifying the path to libsqlite.so on Linux.
  2. Running additional per-connection PRAGMA statements on each connection.
  3. Creating custom SQLite functions.
  4. Creating temporary views or triggers.

Implementation

factory SqliteDatabase.withFactory(
    AbstractDefaultSqliteOpenFactory openFactory,
    {int maxReaders = SqliteDatabase.defaultMaxReaders}) {
  return SqliteDatabaseImpl.withFactory(openFactory, maxReaders: maxReaders);
}