ChildTableConfig
ChildTableConfig =
object
Defined in: packages/forms/src/types.ts:200
Configuration for a child table rendered as a dynamic field array under a parent AutoForm.
Child tables are introspected the same way the parent table is — column types,
required flags, enums, and v() validation rules all flow through. The rendered
form exposes add / remove (and optionally reorder) controls and submits a typed
array of rows under the configured key.
Example
Section titled “Example”createAutoForm({ table: recipes, children: { ingredients: { table: ingredients, foreignKey: "recipe_id", minRows: 1, maxRows: 50, reorderable: true, fields: { name: {}, amount: { placeholder: "g" } }, }, }, onSubmit: async (values) => { // values.ingredients is the typed array of child rows },});Properties
Section titled “Properties”addLabel?
Section titled “addLabel?”
optionaladdLabel:string
Defined in: packages/forms/src/types.ts:222
Override the “Add row” button label.
exclude?
Section titled “exclude?”
optionalexclude:string[]
Defined in: packages/forms/src/types.ts:218
Additional column names to omit from the rendered child rows.
fields?
Section titled “fields?”
optionalfields:Partial<Record<string,FieldConfig>>
Defined in: packages/forms/src/types.ts:216
Per-column overrides for the child table fields, identical in shape to the parent FieldConfig.
foreignKey
Section titled “foreignKey”foreignKey:
string
Defined in: packages/forms/src/types.ts:208
Foreign key column on the child table that points back at the parent. The column is automatically excluded from the rendered child fields and stamped onto each row at submit time.
label?
Section titled “label?”
optionallabel:string
Defined in: packages/forms/src/types.ts:220
Override the heading rendered above the child table (defaults to a humanised key).
maxRows?
Section titled “maxRows?”
optionalmaxRows:number
Defined in: packages/forms/src/types.ts:212
Maximum number of rows the user is allowed to add. Defaults to unlimited.
minRows?
Section titled “minRows?”
optionalminRows:number
Defined in: packages/forms/src/types.ts:210
Minimum number of rows the user must provide. Defaults to 0.
reorderable?
Section titled “reorderable?”
optionalreorderable:boolean
Defined in: packages/forms/src/types.ts:214
Show reorder controls (move up / move down). Defaults to false.
table:
SQLiteTable
Defined in: packages/forms/src/types.ts:202
The Drizzle SQLite table that backs each row of the array.