Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

IndexedDBInstance.md

85 lines1.6 KB

1---
2id: IndexedDBInstance
3title: IndexedDBInstance
4---
5​
6Defined in: [packages/db/src/indexed-db.ts:116](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L116)
7​
8A shared IndexedDB database instance.
9Create with createIndexedDB() and pass to collections.
10​
11## Properties
12​
13### close()
14​
15```ts
16close: () => void;
17```
18​
19Defined in: [packages/db/src/indexed-db.ts:128](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L128)
20​
21Close the connection and mark its managed Collections as errored.
22​
23#### Returns
24​
25`void`
26​
27***
28​
29### db
30​
31```ts
32readonly db: IDBDatabase;
33```
34​
35Defined in: [packages/db/src/indexed-db.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L118)
36​
37The underlying IDBDatabase connection
38​
39***
40​
41### idbFactory?
42​
43```ts
44readonly optional idbFactory: IDBFactory;
45```
46​
47Defined in: [packages/db/src/indexed-db.ts:126](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L126)
48​
49IDBFactory used to create this database (for testing)
50​
51***
52​
53### name
54​
55```ts
56readonly name: string;
57```
58​
59Defined in: [packages/db/src/indexed-db.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L120)
60​
61Database name
62​
63***
64​
65### stores
66​
67```ts
68readonly stores: readonly string[];
69```
70​
71Defined in: [packages/db/src/indexed-db.ts:124](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L124)
72​
73Requested object store names (frozen); omissions do not remove stores
74​
75***
76​
77### version
78​
79```ts
80readonly version: number;
81```
82​
83Defined in: [packages/db/src/indexed-db.ts:122](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L122)
84​
85Database version