createQuerySync(
args
: {engine
:Pick
<LixEngine
,"executeSync"
>; }):QuerySyncFunction
Create a synchronous query builder factory bound to an engine.
Returns a querySync(table)
function that mirrors Kysely's
selectFrom(table)
builder, but with synchronous execution via
.execute()
, .executeTakeFirst()
, and .executeTakeFirstOrThrow()
.
When to use
querySync
into detectChanges()
so
plugins can read current state synchronously while computing changes.querySync
from an in‑process Lix (e.g.
InMemoryEnvironment
) using createQuerySync({ engine: lix.engine! })
and call your plugin's detectChanges({ querySync, ... })
directly.Engine availability
lix.engine
is available and can be passed here.lix.engine
is undefined on the host
thread. In those cases, use integration tests that drive the file
handlers or a test environment that exposes the engine.JSON behavior
snapshot_content
is parsed to objects to match normal Kysely queries.
Other JSON columns are returned as raw JSON strings; parse if needed.Parameter | Type |
---|---|
args | { engine : Pick <LixEngine , "executeSync" >; } |
args.engine | Pick <LixEngine , "executeSync" > |
QuerySyncFunction