Skip to content

FieldDefinition

FieldDefinition = object

Defined in: packages/forms/src/types.ts:48

A field definition produced by introspectTable, describing a single form field.

Contains all metadata needed to render and validate a field: input type, label, required status, enum options, and validation rules derived from both the Drizzle schema and any rules attached via v.

optional enumValues: string[]

Defined in: packages/forms/src/types.ts:62

Available options for enum/select fields, copied from the Drizzle column definition.


hasDefault: boolean

Defined in: packages/forms/src/types.ts:58

Whether the column has a default value defined in the schema.


inputType: InputType

Defined in: packages/forms/src/types.ts:52

The resolved input type based on the Drizzle column type.


isPrimaryKey: boolean

Defined in: packages/forms/src/types.ts:60

Whether the column is the table’s primary key.


label: string

Defined in: packages/forms/src/types.ts:54

Human-readable label derived from the column name (e.g., "Author Id" from "authorId").


name: string

Defined in: packages/forms/src/types.ts:50

The column key from the Drizzle table (e.g., "title", "authorId").


required: boolean

Defined in: packages/forms/src/types.ts:56

Whether the column is NOT NULL (and therefore required in the form).


validation: ValidationRules

Defined in: packages/forms/src/types.ts:64

Merged validation rules from schema introspection and v annotations.