ValidationRules
ValidationRules =
object
Defined in: packages/forms/src/types.ts:19
Validation rules that can be attached to a Drizzle column via the v helper.
These rules are stored as metadata on the column builder and read back by introspectTable to generate client-side validation via createResolver.
Example
Section titled “Example”import { v } from "@cfast/forms";import { text, integer } from "drizzle-orm/sqlite-core";
const title = v(text("title").notNull(), { minLength: 3, maxLength: 200 });const views = v(integer("views"), { min: 0, message: "Views cannot be negative" });Properties
Section titled “Properties”
optionalmax:number
Defined in: packages/forms/src/types.ts:27
Maximum numeric value. Applied to number inputs.
maxLength?
Section titled “maxLength?”
optionalmaxLength:number
Defined in: packages/forms/src/types.ts:23
Maximum string length. Applied to text/varchar inputs.
message?
Section titled “message?”
optionalmessage:string
Defined in: packages/forms/src/types.ts:31
Custom error message displayed when any rule fails. Overrides the auto-generated message.
optionalmin:number
Defined in: packages/forms/src/types.ts:25
Minimum numeric value. Applied to number inputs.
minLength?
Section titled “minLength?”
optionalminLength:number
Defined in: packages/forms/src/types.ts:21
Minimum string length. Applied to text/varchar inputs.
pattern?
Section titled “pattern?”
optionalpattern:RegExp
Defined in: packages/forms/src/types.ts:29
Regex pattern the string value must match.