API reference › @evolu/common › local‑first/Db › DeleteDatabaseFiles
type DeleteDatabaseFiles = (
name: Name,
) => Task<void, DatabaseHeldError | UnknownError>;
Defined in: packages/common/src/local-first/Db.ts:331
Deletes the files of the persistent database name: the database file and
its journal, and on the web the pool directory that holds them. Files that do
not exist count as deleted, so deleting again succeeds. It fails with
DatabaseHeldError when another context keeps holding the files, and
with an UnknownError when the platform fails to delete one, which can
leave the database partly deleted.
startDbWorker calls it while it holds the database's leader lock and the database is closed. It deletes at the file level, so it needs no key and never opens the database.