Home / File/ checks.ts — drizzle-orm Source File

checks.ts — drizzle-orm Source File

Architecture documentation for checks.ts, a typescript file in the drizzle-orm codebase. 3 imports, 2 dependents.

File typescript DrizzleORM DatabaseDrivers 3 imports 2 dependents 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  3bdeabbe_470c_395a_6e44_2d024fc8ee9d["checks.ts"]
  2d5c8884_973c_561c_def6_5e394ea36d1a["table.ts"]
  3bdeabbe_470c_395a_6e44_2d024fc8ee9d --> 2d5c8884_973c_561c_def6_5e394ea36d1a
  27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"]
  3bdeabbe_470c_395a_6e44_2d024fc8ee9d --> 27705a9d_afe9_57dd_8c97_e52d8a67d426
  944a2bed_8787_5f43_03e5_9a3b696c293c["index.ts"]
  3bdeabbe_470c_395a_6e44_2d024fc8ee9d --> 944a2bed_8787_5f43_03e5_9a3b696c293c
  2d5c8884_973c_561c_def6_5e394ea36d1a["table.ts"]
  2d5c8884_973c_561c_def6_5e394ea36d1a --> 3bdeabbe_470c_395a_6e44_2d024fc8ee9d
  ce49a5a3_688d_ddce_fd32_28428e51cae2["utils.ts"]
  ce49a5a3_688d_ddce_fd32_28428e51cae2 --> 3bdeabbe_470c_395a_6e44_2d024fc8ee9d
  style 3bdeabbe_470c_395a_6e44_2d024fc8ee9d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { entityKind } from '~/entity.ts';
import type { SQL } from '~/sql/index.ts';
import type { PgTable } from './table.ts';

export class CheckBuilder {
	static readonly [entityKind]: string = 'PgCheckBuilder';

	protected brand!: 'PgConstraintBuilder';

	constructor(public name: string, public value: SQL) {}

	/** @internal */
	build(table: PgTable): Check {
		return new Check(table, this);
	}
}

export class Check {
	static readonly [entityKind]: string = 'PgCheck';

	readonly name: string;
	readonly value: SQL;

	constructor(public table: PgTable, builder: CheckBuilder) {
		this.name = builder.name;
		this.value = builder.value;
	}
}

export function check(name: string, value: SQL): CheckBuilder {
	return new CheckBuilder(name, value);
}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does checks.ts do?
checks.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, DatabaseDrivers subdomain.
What functions are defined in checks.ts?
checks.ts defines 1 function(s): check.
What does checks.ts depend on?
checks.ts imports 3 module(s): entity.ts, index.ts, table.ts.
What files import checks.ts?
checks.ts is imported by 2 file(s): table.ts, utils.ts.
Where is checks.ts in the architecture?
checks.ts is located at drizzle-orm/src/pg-core/checks.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: drizzle-orm/src/pg-core).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free