[**@jupyterlite**](../../../README.md) *** [@jupyterlite](../../../README.md) / [@jupyterlite/apputils](../README.md) / IndexedDBDataConnector # Class: IndexedDBDataConnector\ Defined in: [packages/apputils/src/statedb.ts:15](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L15) A StateDB data connector backed by IndexedDB ## Extended by - [`LiteWorkspaceManager`](LiteWorkspaceManager.md) ## Type Parameters ### T `T` ## Implements - `IDataConnector`\<`T`\> ## Constructors ### Constructor > **new IndexedDBDataConnector**\<`T`\>(`options`): `IndexedDBDataConnector`\<`T`\> Defined in: [packages/apputils/src/statedb.ts:21](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L21) Construct a new IndexedDBDataConnector. #### Parameters ##### options [`IOptions`](../namespaces/IndexedDBDataConnector/interfaces/IOptions.md) The options for the data connector. #### Returns `IndexedDBDataConnector`\<`T`\> ## Accessors ### defaultStorageOptions #### Get Signature > **get** `protected` **defaultStorageOptions**(): `LocalForageOptions` Defined in: [packages/apputils/src/statedb.ts:55](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L55) Get default options for localForage instances ##### Returns `LocalForageOptions` *** ### storage #### Get Signature > **get** `protected` **storage**(): `Promise`\<`LocalForage`\> Defined in: [packages/apputils/src/statedb.ts:41](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L41) A lazy reference to the underlying storage. ##### Returns `Promise`\<`LocalForage`\> ## Methods ### createStorage() > `protected` **createStorage**(): `LocalForage` Defined in: [packages/apputils/src/statedb.ts:69](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L69) Initialize the default storage for contents. #### Returns `LocalForage` *** ### fetch() > **fetch**(`id`): `Promise`\<`undefined` \| `T`\> Defined in: [packages/apputils/src/statedb.ts:84](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L84) Fetch a value from the data connector. #### Parameters ##### id `string` The identifier of the value to fetch. #### Returns `Promise`\<`undefined` \| `T`\> A promise that resolves with the fetched value, or undefined if not found. #### Implementation of `IDataConnector.fetch` *** ### initialize() > **initialize**(): `Promise`\<`void`\> Defined in: [packages/apputils/src/statedb.ts:33](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L33) Initialize the data connector. #### Returns `Promise`\<`void`\> *** ### initStorage() > `protected` **initStorage**(): `Promise`\<`void`\> Defined in: [packages/apputils/src/statedb.ts:48](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L48) Initialize storage instance #### Returns `Promise`\<`void`\> *** ### list() > **list**(`namespace`): `Promise`\<\{ `ids`: `string`[]; `values`: `T`[]; \}\> Defined in: [packages/apputils/src/statedb.ts:96](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L96) List all values in a namespace. #### Parameters ##### namespace `string` = `''` The namespace to list values from. Defaults to ''. #### Returns `Promise`\<\{ `ids`: `string`[]; `values`: `T`[]; \}\> A promise that resolves with the list of IDs and values. #### Implementation of `IDataConnector.list` *** ### remove() > **remove**(`id`): `Promise`\<`void`\> Defined in: [packages/apputils/src/statedb.ts:127](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L127) Remove a value from the data connector. #### Parameters ##### id `string` The identifier of the value to remove. #### Returns `Promise`\<`void`\> A promise that resolves when the value is removed. #### Implementation of `IDataConnector.remove` *** ### save() > **save**(`id`, `value`): `Promise`\<`void`\> Defined in: [packages/apputils/src/statedb.ts:139](https://github.com/jupyterlite/jupyterlite/blob/14439ec34e3cade5baa221a050277e15da9d0c06/packages/apputils/src/statedb.ts#L139) Save a value to the data connector. #### Parameters ##### id `string` The identifier of the value to save. ##### value `T` The value to save. #### Returns `Promise`\<`void`\> A promise that resolves when the value is saved. #### Implementation of `IDataConnector.save`