Skip to content

@yantrix/storage v0.6.0 • Docs


Yantrix API / @yantrix/storage / TIndexedDBStorageAdapterProps

Type Alias: TIndexedDBStorageAdapterProps ​

ts
type TIndexedDBStorageAdapterProps: object;

Connection and snapshot options for an IndexedDB-backed Storage.

Type declaration ​

databaseName? ​

ts
optional databaseName: string;

IndexedDB database name. Defaults to 'yantrix'. All adapters sharing this name use the same databaseVersion.

databaseVersion? ​

ts
optional databaseVersion: number;

Use the same databaseVersion (default 1) for all adapters sharing a databaseName. An adapter configured below the stored schema version gets VersionError. Adding a missing object store to an existing database raises its physical IndexedDB version, which can exceed databaseVersion. All other open connections to that database, including those in other tabs, must close before the upgrade can finish. Yantrix adapters close on versionchange and reopen on their next operation.

id ​

ts
id: string;

Identifies this Storage and supplies the default snapshot key.

indexedDB? ​

ts
optional indexedDB: IIndexedDBFactoryLike;

IndexedDB factory to use. Defaults to the environment's indexedDB.

key? ​

ts
optional key: string;

Key for the snapshot in the object store. Defaults to id.

openTimeoutMs? ​

ts
optional openTimeoutMs: number;

openTimeoutMs defaults to 5000 ms and covers the entire open, including waiting for connections to close and provisioning the store.

storeName? ​

ts
optional storeName: string;

Object store for snapshots. Defaults to 'models'. The store name '\u0000yantrix/storage/schema' is reserved.