prorm API Reference
    Preparing search index...

    Function Check

    • @Check decorator — attach CHECK constraints to a column or multiple columns.

      For column-level use (on class property): @Check({ age: { $gte: 18 } }) age: number;

      For multiple checks: @Check({ status: { $in: ['active', 'pending'] }, email: { $regex: '^[^@]+@[^@]+$' } }) email: string;

      For row-level condition: @Check({ condition: (row) => row.startDate < row.endDate, message: 'Start date must be before end date' }) startDate: Date;

      Parameters

      Returns PropertyDecorator