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.
Properties
Section titled “Properties”enumValues?
Section titled “enumValues?”
optionalenumValues:string[]
Defined in: packages/forms/src/types.ts:62
Available options for enum/select fields, copied from the Drizzle column definition.
hasDefault
Section titled “hasDefault”hasDefault:
boolean
Defined in: packages/forms/src/types.ts:58
Whether the column has a default value defined in the schema.
inputType
Section titled “inputType”inputType:
InputType
Defined in: packages/forms/src/types.ts:52
The resolved input type based on the Drizzle column type.
isPrimaryKey
Section titled “isPrimaryKey”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
Section titled “required”required:
boolean
Defined in: packages/forms/src/types.ts:56
Whether the column is NOT NULL (and therefore required in the form).
validation
Section titled “validation”validation:
ValidationRules
Defined in: packages/forms/src/types.ts:64
Merged validation rules from schema introspection and v annotations.