[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Db](https://evolu.dev/docs/api-reference/common/local-first/Db) › DeleteDatabaseFiles

```ts
type DeleteDatabaseFiles = (
  name: Name,
) => Task<void, DatabaseHeldError | UnknownError>;
```

Defined in: [packages/common/src/local-first/Db.ts:331](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/common/src/local-first/Db.ts#L331)

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](https://evolu.dev/docs/api-reference/common/local-first/Db/interfaces/DatabaseHeldError) when another context keeps holding the files, and
with an [UnknownError](https://evolu.dev/docs/api-reference/common/Error/variables/UnknownError) when the platform fails to delete one, which can
leave the database partly deleted.

[startDbWorker](https://evolu.dev/docs/api-reference/common/local-first/Db/functions/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.