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 SQLDialects 3 imports 2 dependents 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  7b63b5bd_ea98_c5c2_5af8_ff11f417af24["checks.ts"]
  62c695d3_7eff_3822_db70_ce6b25ccdb04["table.ts"]
  7b63b5bd_ea98_c5c2_5af8_ff11f417af24 --> 62c695d3_7eff_3822_db70_ce6b25ccdb04
  27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"]
  7b63b5bd_ea98_c5c2_5af8_ff11f417af24 --> 27705a9d_afe9_57dd_8c97_e52d8a67d426
  be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd["sql.ts"]
  7b63b5bd_ea98_c5c2_5af8_ff11f417af24 --> be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd
  62c695d3_7eff_3822_db70_ce6b25ccdb04["table.ts"]
  62c695d3_7eff_3822_db70_ce6b25ccdb04 --> 7b63b5bd_ea98_c5c2_5af8_ff11f417af24
  af63b8b3_1221_118f_75ac_f0b56c078499["utils.ts"]
  af63b8b3_1221_118f_75ac_f0b56c078499 --> 7b63b5bd_ea98_c5c2_5af8_ff11f417af24
  style 7b63b5bd_ea98_c5c2_5af8_ff11f417af24 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

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

	protected brand!: 'MySqlConstraintBuilder';

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

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

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

	readonly name: string;
	readonly value: SQL;

	constructor(public table: MySqlTable, 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, SQLDialects 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, sql.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/mysql-core/checks.ts (domain: DrizzleORM, subdomain: SQLDialects, directory: drizzle-orm/src/mysql-core).

Analyze Your Own Codebase

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

Try Supermodel Free