@kovojs/drizzle
Generated from 2 public subpaths — 6 exports, 6 documented. Do not edit by hand.
@kovojs/drizzle#
Drizzle adapter: table annotations, touch-graph extraction from queries, and invalidation registry derivation.
Source: packages/drizzle/src/runtime.ts
Functions#
kovo#
Annotate a Drizzle table with the invalidation domain it belongs to (or mark
it exempt). Used in a table's extra-config callback so the compiler can
extract the touch graph from queries and writes against that table — the
Drizzle-blessed path to schema-as-domain-registry (SPEC §10.1).
| Parameter | Type | Description |
|---|---|---|
annotation |
KovoTableAnnotation |
A { domain, key? } binding, or { exempt: true }. |
| (returns) | KovoTableExtraConfig |
A KovoTableExtraConfig to return from the table's extra-config callback. |
function kovo(annotation: KovoTableAnnotation): KovoTableExtraConfig;Example
import { kovo } from '@kovojs/drizzle';
export const cartConfig = () => kovo({ domain: 'cart', key: 'id' });Types & interfaces#
DiagnosticCode#
The string-literal union of every KV### diagnostic code the framework can emit.
type DiagnosticCode =
| 'KV201'
| 'KV210'
| 'KV211'
| 'KV212'
| 'KV220'
| 'KV221'
| 'KV222'
| 'KV223'
| 'KV224'
| 'KV225'
| 'KV226'
| 'KV227'
| 'KV228'
| 'KV230'
| 'KV231'
| 'KV232'
| 'KV233'
| 'KV234'
| 'KV235'
| 'KV236'
| 'KV237'
| 'KV238'
| 'KV239'
| 'KV240'
| 'KV241'
| 'KV242'
| 'KV301'
| 'KV302'
| 'KV303'
| 'KV304'
| 'KV310'
| 'KV311'
| 'KV320'
| 'KV330'
| 'KV402'
| 'KV403'
| 'KV404'
| 'KV405'
| 'KV406'
// … truncated (5 more lines); see the package source for the full declaration.KovoDomainTableAnnotation#
The domain-bearing form of a table annotation: its domain and optional key column.
interface KovoDomainTableAnnotation {
domain: string;
key?: string;
}KovoTableAnnotation#
A Kovo annotation on a Drizzle table: a domain (with optional row key), or an exempt marker.
type KovoTableAnnotation =
| {
domain: string;
key?: string;
}
| {
exempt: true;
};KovoTableExtraConfig#
The value kovo(...) returns: a Drizzle extra-config callback carrying the annotation.
type KovoTableExtraConfig = KovoDomainTableAnnotation &
((self: unknown) => []) & {
exempt?: true;
};@kovojs/drizzle/derive#
Drizzle adapter: table annotations, touch-graph extraction from queries, and invalidation registry derivation.
Source: packages/drizzle/src/derive.ts
Functions#
deriveOptimistic#
Derive the optimistic patch program for one (mutation × invalidated query)
pair: push every mutation effect through the query shape. Returns a
derived(PatchProgram) or a punt(PuntReason) from the §10.5 PUNT list.
function deriveOptimistic(
effects: readonly SymbolicEffect[],
shape: AlgebraicQueryShape,
): DerivationResult;