Remote / foldkit-remote-drizzle
Diagnose the first read
| Symptom | Check |
|---|---|
| Missing service at execution | Provide DrizzleDatabase using your application's database layer. |
| A row is absent for one caller | Inspect the binding's visible rule with that principal. |
| A field is absent from a returned row | Check the Selection, authorize, and column/member mapping. |
| A relation works by itself but not nested | Check that the target binding's Source is registered too. |
| A query cannot compile | Check the interpreter's supported query capabilities before changing the client. |
Start with one id and one scalar before adding relations or pagination. The Entity example provides a runnable baseline.
Dialect and limits
The binding accepts Drizzle's base Table, but the pagination semantics are
currently designed around Postgres behavior:
- windowed nested pagination needs window functions and row-value
IN(Postgres, SQLite 3.25+, MySQL 8+); - computed fields are counts only;
- there is no mutation DSL;
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.
The SQLite integration tests are a real SQL/compiler check, but they do not prove every Postgres-specific NULL-ordering edge case.
Cloudflare D1
The same reads run over D1, through drizzle-orm/d1, with no adapter
changes: windowed collection pages (row_number() over (partition by …)),
row-value membership, LIKE … ESCAPE, COLLATE "C" search, keyset queries,
and returning are all statements D1 accepts. test/d1.test.ts proves the
core paths against a miniflare binding, which rejects what production D1
rejects; databaseLayer(drizzle(env.DB)) is the only wiring. The
nullable-column rule above applies as on SQLite: D1 sorts nulls first for
ASC, so sort by columns that are not null.
License
MIT. The keyset-cursor and projection logic adapts
fate's Drizzle integration (MIT, Copyright
(c) 2025 Nakazawa Tech); see THIRD_PARTY_NOTICES.md.
See also
- Server-derived state — why Remote requirements exist and who owns server-derived state.
foldkit-remote— client requirements, normalized Model, subscriptions, mutations, and live data.foldkit-remote-server— Source authorization, normalization, handlers, and live infrastructure.examples/kitchen-sink— Remote + Drizzle + RemoteServer in one executable trace.