Interface: LixStorageAdapter

Methods

close()

close(): Promise<void>

Closes the database and cleans up resources.

Returns

Promise<void>


connect()?

optional connect(args): void

Called after the Lix instance is fully initialized. Allows storage adapters to set up observers, hooks, etc.

Parameters

args

Object containing the Lix instance and future options

lix

Lix

Returns

void


export()

export(): Promise<Blob>

Exports the current storage state as a blob.

Returns

Promise<Blob>


getPersistedState()?

optional getPersistedState(): Promise<undefined | { activeAccounts?: Pick<{ id: LixGenerated<string>; name: string; }, "id" | "name">[]; }>

Returns any persisted state that should be restored. Called during Lix initialization to restore saved state.

Returns

Promise<undefined | { activeAccounts?: Pick<{ id: LixGenerated<string>; name: string; }, "id" | "name">[]; }>

Promise resolving to persisted state, or undefined if none


import()

import(blob): Promise<void>

Imports data from a blob into the storage.

Parameters

blob

Blob

Returns

Promise<void>


open()

open(): Promise<SqliteWasmDatabase>

Opens and returns the database instance.

Returns

Promise<SqliteWasmDatabase>