buildRegistryReadHandles
buildRegistryReadHandles<
TRegistry>(registry,client?):object
Defined in: packages/client/src/index.ts:3666
The tab-side READ handles a worker-attached client exposes (ADR-0032 S2/decision 4): a Drizzle instance
plus the registry views. createSyncClient’s SAME builders, so a query built on either client compiles
identically. The client argument is the executor Drizzle runs against:
- Omit it (the default
{}stub) for a BUILD-ONLY instance — Drizzle only compiles to SQL (.toSQL()) and the stub is never invoked; used where execution happens elsewhere (e.g. the live-rows bridge). - Pass a
ClientPGlite-shaped BRIDGE executor (itsqueryroutes to the worker’sguardedQueryRPC) so that awaiting a builder executes through the bridge and Drizzle’s own result mapping (relational/nested queries included) runs on the tab — the one-shot read pathattachSyncClientwires (ADR-0032 decision 4).
Type Parameters
Section titled “Type Parameters”TRegistry
Section titled “TRegistry”TRegistry extends SyncTableRegistry
Parameters
Section titled “Parameters”registry
Section titled “registry”TRegistry
client?
Section titled “client?”ClientPGlite = ...
Returns
Section titled “Returns”drizzle
Section titled “drizzle”drizzle:
PgliteDatabase<ExtractTablesWithRelations<{ },RegistryTables<TRegistry>>>
drizzleFor
Section titled “drizzleFor”drizzleFor: (
client) =>PgliteDatabase<ExtractTablesWithRelations<{ },RegistryTables<TRegistry>>>
A drizzle-database FACTORY over this registry’s schema (ADR-0032 decision 4): (client) => db, reusing
the schema + relations computed ONCE here so a caller can cheaply build additional per-executor databases
without recomputing them. attachSyncClient uses it to give each queryRaw/queryRawRow its OWN
bridge executor carrying that call’s use — a scoped db, never a shared mutable stash (no read races).
Parameters
Section titled “Parameters”client
Section titled “client”Returns
Section titled “Returns”PgliteDatabase<ExtractTablesWithRelations<{ }, RegistryTables<TRegistry>>>
views:
RegistryViews<TRegistry>