Module

x/kysely_postgrs_js_dialect/mod.ts>kysely.ColumnDefinitionBuilder#check

Kysely dialect for PostgreSQL using the Postgres.js client.
Latest
method kysely.ColumnDefinitionBuilder.prototype.check
import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.4/mod.ts";
const { ColumnDefinitionBuilder } = kysely;

Adds a check constraint for the column.

Examples

import { sql } from 'kysely'

db.schema
  .createTable('pet')
  .addColumn('number_of_legs', 'integer', (col) =>
    col.check(sql`number_of_legs < 5`)
  )
  .execute()

Parameters

expression: Expression<any>