docs: resolve OQ-11 and OQ-12 with ADR-015 and ADR-016

ADR-015: <table> accepts extraConfig prop mirroring Drizzle's third
callback argument for composite unique constraints and other
column-reference-based features.

ADR-016: Adapter accepts Type.Module compiled bundle (not individual
schemas). M.Import() handles ref resolution automatically, eliminating
potential complications with separate schema wiring.

Update FromDbTypeConfig interface to use module instead of schema,
update element types table with extraConfig prop.
This commit is contained in:
2026-05-23 13:02:23 +00:00
parent 98764086f4
commit da65f7b693
5 changed files with 152 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ The top-level schema element. Contains `<column>`, `<index>`, and `<fk>` childre
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `name` | `string` | yes | Table name in the database |
| `extraConfig` | `(columns: Record<string, any>) => Record<string, any>` | no | Drizzle third-argument callback. Receives rendered column builders, returns an object for composite unique constraints, partial indexes, and other column-reference-based features. See [ADR-015](decisions/015-table-extraconfig-props.md). |
Children are column, index, and foreign key elements. Function component children that return column elements are transparent (their output is used, not the component itself).
@@ -235,7 +236,7 @@ interface TableMeta {
1. ~~Should column elements support `inner` TypeBox schemas?~~ **Resolved — Yes. ADR-007: flat props for common cases, `inner` as escape hatch for custom validation.** The `inner` prop is now documented in the column props table.
2. **Should `<table>` accept `extraConfig` props?** Drizzle tables accept a third callback argument for indexes and unique constraints defined in terms of column references. How does this map to element props? (See [OQ-11](open-questions.md))
2. ~~**Should `<table>` accept `extraConfig` props?**~~ **Resolved — ADR-015**. Yes — the `<table>` element accepts an `extraConfig` prop that mirrors Drizzle's third callback argument. It receives the rendered column builders and returns an object for composite unique constraints, partial indexes, and other column-reference-based features. Consistent with the `inner` escape hatch pattern on `<column>`.
3. ~~**Should we support JSX file extensions?**~~ **Resolved — ADR-011**. JSX/TSX is supported as an ergonomic authoring layer. JSX desugars to `h()` calls via `jsxImportSource: '@alkdev/ujsx'`. The `h()` API remains the universal fallback. TSConfig must set `jsx: 'react-jsx'` and `jsxImportSource: '@alkdev/ujsx'`.