- 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
IndexedDBCollectionUtils
Defined in: packages/db/src/indexed-db.ts:219
Utility functions exposed on collection.utils
Extends#
Type Parameters#
TItem#
TItem extends object = Record<string, unknown>
TInsertInput#
TInsertInput extends object = TItem
Indexable#
[key: string]: anyProperties#
acceptMutations()#
acceptMutations: (transaction) => Promise<void>;Defined in: packages/db/src/indexed-db.ts:237
Accepts mutations from a manual transaction and persists to IndexedDB
Parameters#
transaction#
mutations#
PendingMutation<Record<string, unknown>, OperationType, Collection<Record<string, unknown>, any, any, any, any>>[]
Returns#
Promise<void>
clearObjectStore()#
clearObjectStore: () => Promise<void>;Defined in: packages/db/src/indexed-db.ts:227
Removes all data from the object store Does NOT delete the database itself
Returns#
Promise<void>
exportData()#
exportData: () => Promise<TItem[]>;Defined in: packages/db/src/indexed-db.ts:245
Exports all data from the object store as an array Useful for backup/debugging
Returns#
Promise<TItem[]>
getDatabaseInfo()#
getDatabaseInfo: () => Promise<DatabaseInfo>;Defined in: packages/db/src/indexed-db.ts:232
Returns database information for debugging
Returns#
Promise<DatabaseInfo>
importData()#
importData: (items) => Promise<void>;Defined in: packages/db/src/indexed-db.ts:251
Validates input rows and atomically replaces the object store. Failure preserves the previous rows and versions.
Parameters#
items#
TInsertInput[]
Returns#
Promise<void>