In-process, in-memory environment.
Runs on the calling thread; great for tests, CLI, or light usage. In browsers, heavy operations can block the UI – prefer the Worker environment for production use.
new InMemoryEnvironment():
InMemoryEnvironment
InMemoryEnvironment
call(
name
:string
,payload?
:unknown
,opts?
: {signal?
:AbortSignal
; }):Promise
<unknown
>
Invoke an engine function inside the environment.
Environments MUST implement this and route the call to the engine that booted next to SQLite, regardless of whether the engine runs on the main thread or inside a Worker. The SQL driver uses the "lix_exec_sync" route to execute compiled statements.
Parameter | Type |
---|---|
name | string |
payload? | unknown |
opts? | { signal? : AbortSignal ; } |
opts.signal? | AbortSignal |
Promise
<unknown
>
LixEnvironment.call
close():
Promise
<void
>
Promise
<void
>
create(
opts
: {blob
:ArrayBuffer
; }):Promise
<void
>
Parameter | Type |
---|---|
opts | { blob : ArrayBuffer ; } |
opts.blob | ArrayBuffer |
Promise
<void
>
exists():
Promise
<boolean
>
Promise
<boolean
>
export():
Promise
<ArrayBuffer
>
Promise
<ArrayBuffer
>
open(
opts
: {boot
: {args
:BootArgs
; };emit
: (ev
:EngineEvent
) =>void
; }):Promise
<{engine?
:LixEngine
; }>
Parameter | Type |
---|---|
opts | { boot : { args : BootArgs ; }; emit : (ev : EngineEvent ) => void ; } |
opts.boot | { args : BootArgs ; } |
opts.boot.args | BootArgs |
opts.emit | (ev : EngineEvent ) => void |
Promise
<{ engine?
: LixEngine
; }>