DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/deleteDatabase.md
deleteDatabase
ts
function deleteDatabase(
name,
idbFactory?,
onBlocked?): Promise<void>;Defined in: packages/db/src/indexed-db-wrapper.ts:558
Deletes an entire IndexedDB database. A blocked request stays pending until native success or error.
Use with caution - this removes the database and all of its object stores and data.
Parameters#
name#
string
The name of the database to delete
idbFactory?#
IDBFactory
Optional IDBFactory for testing/mocking
onBlocked?#
(event) => void
Optional diagnostic callback for native blocked events. The request stays pending.
Returns#
Promise<void>
A promise that resolves when the database is deleted
Example#
ts
await deleteDatabase('myApp')
console.log('Database deleted')