API reference › @evolu/web › createWaitForDatabaseRelease

function createWaitForDatabaseRelease(
  deps: OpfsRootDep & SqliteWasmLoadDep,
): WaitForDatabaseRelease;

Defined in: packages/web/src/Sqlite.ts:254

Creates the WaitForDatabaseRelease of Evolu for the web. It opens the pool createWasmSqliteDriver opens for the database, and disposes it once it opens.

When another context holds a file of the pool, the pool is opened again after 50 ms, then after twice the previous delay, up to a second, with the heldTimeout option of openSahPool, and the wait fails with DatabaseHeldError when it is still held databaseHeldTimeout after the first attempt started. Evolu then refuses to start the database, and the app receives the error as its evoluError. Every other error is thrown, as the driver throws it.