close():
Promise
<void
>
Closes the database and cleans up resources.
Promise
<void
>
optional
connect(args
: {lix
:Lix
; }):void
Called after the Lix instance is fully initialized. Allows storage adapters to set up observers, hooks, etc.
Parameter | Type | Description |
---|---|---|
args | { lix : Lix ; } | Object containing the Lix instance and future options |
args.lix | Lix | - |
void
export():
Promise
<Blob
>
Exports the current storage state as a blob.
Promise
<Blob
>
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.
Promise
<undefined
| { activeAccounts?
: Pick
<{ id
: LixGenerated
<string
>; name
: string
; }, "id"
| "name"
>[]; }>
Promise resolving to persisted state, or undefined if none
open(
args
: {blob?
:Blob
;createBlob
: () =>Promise
<Blob
>; }):Promise
<SqliteWasmDatabase
>
Opens and returns the database instance.
Parameter | Type | Description |
---|---|---|
args | { blob? : Blob ; createBlob : () => Promise <Blob >; } | Arguments for opening the storage |
args.blob? | Blob | Optional blob to initialize the storage with (takes precedence over existing data) |
args.createBlob | () => Promise <Blob > | Callback to create a new blob if no existing data is found |
Promise
<SqliteWasmDatabase
>