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.
Parameters
Section titled “Parameters”SQLiteTable
A Drizzle SQLiteTable to introspect.
Returns
Section titled “Returns”An array of FieldDefinition objects, one per column in the table.
Example
Section titled “Example”import { introspectTable } from "@cfast/forms";import { posts } from "./schema";
const fields = introspectTable(posts);// [{ name: "title", inputType: "text", label: "Title", required: true, ... }, ...]