Remote / foldkit-remote-drizzle
Diagnostics
Two things the adapter goes past without telling the caller are reported
through foldkit-surface's Diagnostics channel (re-exported by
foldkit-remote), by default Effect's log:
_tag | level | When |
|---|---|---|
StatementFailed | error | The driver failed a statement (runStatement, every read and write here); the caller was answered failed (Database query failed for a read or query, Database write failed for a write), and this carries the driver's error, with its SQL. |
ServerOnlyRules | warning | Once per binding, on its first write through writer: the Entity's rules no CHECK can hold (checkConstraints(...).serverOnly), held by the server's declared writes alone. Nothing when there are none. |
Each is reported inside the read or write, so the reporter the server runs
with applies: serveFetch's diagnostics, or
Layer.succeed(Diagnostics.Reporter, report) in its layer. In a test,
provide Diagnostics.collect().report and assert on reported.
Dialect and limits
The binding accepts Drizzle's base Table; the compiler writes SQL for SQLite
(D1 included) and Postgres, and the tests run it on both (node:sqlite and
PGlite):
- a collection read, whole or windowed, needs row-value
INand a correlated subquery with alimit(Postgres, SQLite 3.15+); - computed and derived members are counts, and
Derived.exists; - a declared write is one row's update, insert or delete; anything else is a handler;
reader, the injected-executor path, does not load collections or computed fields;- nested targets remain normalized refs and are resolved by
foldkit-remote-server, never embedded objects.