Type Alias: Lix

Lix = object

Properties

close()

close: () => Promise<void>

Closes the lix instance and its storage.

Returns

Promise<void>


db

db: Kysely<LixDatabaseSchema>


hooks

hooks: LixHooks

Hooks for listening to database lifecycle events.

Allows registering callbacks that fire at specific points in Lix's execution, such as when state changes are committed.


observe

observe: ReturnType<typeof createObserve>


plugin

plugin: object

getAll()

getAll: () => Promise<LixPlugin[]>

Returns

Promise<LixPlugin[]>

getAllSync()

getAllSync: () => LixPlugin[]

Returns

LixPlugin[]


sqlite

sqlite: SqliteWasmDatabase

The raw SQLite instance.

Required for advanced use cases that can't be expressed with the db API.

Use with caution, automatic transformation of results like parsing json (similar to the db API) is not guaranteed.


toBlob()

toBlob: () => Promise<Blob>

Serialises the Lix into a Blob.

Use this helper to persist the current state to disk or send it to a server. The blob contains the raw SQLite file representing the Lix project.

Returns

Promise<Blob>

Example

const blob = await lix.toBlob()
download(blob)