API reference › @evolu/web › createDeleteDatabaseFiles

function createDeleteDatabaseFiles(
  deps: OpfsRootWithRemoveEntryDep & SqliteWasmLoadDep,
): DeleteDatabaseFiles;

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

Creates the DeleteDatabaseFiles of Evolu for the web. It opens the pool createWasmSqliteDriver opens for the database, waiting for held files as createWaitForDatabaseRelease does, deletes /evolu1.db with its journal, disposes the pool, and removes the pool's directory .<name> with every slot of the pool. A missing file counts as deleted, and so does a missing directory, which it then doesn't create.

It fails with DatabaseHeldError when another context still holds a file of the pool databaseHeldTimeout after the first attempt, and deletes nothing. Any other failure, such as SQLite that failed to load or a file that could not be deleted, fails with an UnknownError, after which only the pool's disposal still runs.