Module

x/kysely_postgrs_js_dialect/deps.ts>kysely.CreateTableBuilder#addCheckConstraint

Kysely dialect for PostgreSQL using the Postgres.js client.
method kysely.CreateTableBuilder.prototype.addCheckConstraint
import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/deps.ts";
const { CreateTableBuilder } = kysely;

Adds a check constraint.

The constraint name can be anything you want, but it must be unique across the whole database.

Examples

import { sql } from 'kysely'

addCheckConstraint('check_legs', sql`number_of_legs < 5`)

Parameters

constraintName: string
checkExpression: Expression<any>