[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) › WaitForDatabaseRelease

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

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

Waits until no other context holds the files of the persistent database
`name`, and fails with [DatabaseHeldError](https://evolu.dev/docs/api-reference/common/local-first/Db/interfaces/DatabaseHeldError) when they stay held.

[startDbWorker](https://evolu.dev/docs/api-reference/common/local-first/Db/functions/startDbWorker) calls it, except for a memory-only database, while it
holds the database's leader lock and before it opens the database. Only a
context that ended without closing the database can then hold its files, and
such a context can only release them, so the files stay free until the
database opens. Platforms whose databases cannot be held this way, such as
Node.js and React Native, omit it.