Class: InMemoryStorage

In-memory storage adapter for Lix.

Data is stored only for the lifetime of the JavaScript context. When the page is refreshed or the application is closed, all data is lost.

Implements

Constructors

Constructor

new InMemoryStorage(): InMemoryStorage

Returns

InMemoryStorage

Methods

close()

close(): Promise<void>

Closes the database connection.

Note: For in-memory databases, this just clears the reference. The data is lost when the database is no longer referenced.

Returns

Promise<void>

Implementation of

LixStorageAdapter.close


export()

export(): Promise<Blob>

Exports the current database state as a blob.

Returns

Promise<Blob>

Implementation of

LixStorageAdapter.export


import()

import(blob): Promise<void>

Imports data from a blob, replacing the current database content.

Parameters

blob

Blob

Returns

Promise<void>

Implementation of

LixStorageAdapter.import


open()

open(): Promise<SqliteWasmDatabase>

Opens an in-memory SQLite database.

Creates a new empty lix if this is the first time opening. Returns the same database instance on subsequent calls.

Returns

Promise<SqliteWasmDatabase>

Implementation of

LixStorageAdapter.open