Skip to content

introspectTable

introspectTable(table): FieldDefinition[]

Defined in: packages/forms/src/introspect.ts:55

Introspect a Drizzle SQLite table and produce field definitions for form generation.

Reads column metadata (type, nullability, defaults, enums) and merges it with any ValidationRules attached via the v helper. The resulting FieldDefinition array is used by createResolver for validation and by the AutoForm component for rendering.

SQLiteTable

A Drizzle SQLiteTable to introspect.

FieldDefinition[]

An array of FieldDefinition objects, one per column in the table.

import { introspectTable } from "@cfast/forms";
import { posts } from "./schema";
const fields = introspectTable(posts);
// [{ name: "title", inputType: "text", label: "Title", required: true, ... }, ...]