What is the import { check } used for from from "drizzle-orm/pg-core"

Anyone know what the check function imported from "drizzle-orm/pg-core" does? I believe check constraints are still not implemented so I'm not sure? Here's what it's definition looks like:
import { entityKind } from "../entity.js";
import type { SQL } from "../sql/index.js";
import type { PgTable } from "./table.js";
export declare class CheckBuilder {
name: string;
value: SQL;
static readonly [entityKind]: string;
protected brand: 'PgConstraintBuilder';
constructor(name: string, value: SQL);
}
export declare class Check {
table: PgTable;
static readonly [entityKind]: string;
readonly name: string;
readonly value: SQL;
constructor(table: PgTable, builder: CheckBuilder);
}
export declare function check(name: string, value: SQL): CheckBuilder;
import { entityKind } from "../entity.js";
import type { SQL } from "../sql/index.js";
import type { PgTable } from "./table.js";
export declare class CheckBuilder {
name: string;
value: SQL;
static readonly [entityKind]: string;
protected brand: 'PgConstraintBuilder';
constructor(name: string, value: SQL);
}
export declare class Check {
table: PgTable;
static readonly [entityKind]: string;
readonly name: string;
readonly value: SQL;
constructor(table: PgTable, builder: CheckBuilder);
}
export declare function check(name: string, value: SQL): CheckBuilder;
2 Replies
MAST
MAST10mo ago
The only check I know of is in drizzle-kit https://orm.drizzle.team/kit-docs/commands#check
Drizzle ORM - List of commands
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
MAST
MAST10mo ago
Maybe drizzle-kit uses these? Or a WIP for checks in the database.
Want results from more Discord servers?
Add your server