fieldForColumn
fieldForColumn(
column):FieldComponent
Defined in: packages/ui/src/fields/field-for-column.ts:38
Maps a Drizzle column’s metadata to the appropriate TypedField component.
Inspects the column’s dataType and name to determine the best display
component. The mapping follows these rules:
booleanor integer columns namedis*-> BooleanField- Columns containing
timestamp,date, ordatetime-> DateField - Numeric types (
integer,real,float, etc.) -> NumberField - Columns named
emailor*Email-> EmailField json,jsonb, orblob-> JsonField- Everything else -> TextField
Parameters
Section titled “Parameters”column
Section titled “column”ColumnMeta
Drizzle column metadata with dataType and name properties.
Returns
Section titled “Returns”FieldComponent
A React component suitable for displaying the column’s values.
Example
Section titled “Example”import { fieldForColumn } from "@cfast/ui";
const Field = fieldForColumn({ dataType: "timestamp", name: "createdAt" });// Field === DateField