Home / Class/ PgCharBuilder Class — drizzle-orm Architecture

PgCharBuilder Class — drizzle-orm Architecture

Architecture documentation for the PgCharBuilder class in char.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  8c89b24d_db5b_dccf_7a0e_83cd57fdb81a["PgCharBuilder"]
  eb53d002_51a7_6f92_43e3_0451f4322791["char.ts"]
  8c89b24d_db5b_dccf_7a0e_83cd57fdb81a -->|defined in| eb53d002_51a7_6f92_43e3_0451f4322791
  85516d24_2a5a_3aa9_d185_fa6f05dd1729["constructor()"]
  8c89b24d_db5b_dccf_7a0e_83cd57fdb81a -->|method| 85516d24_2a5a_3aa9_d185_fa6f05dd1729
  57b36aa4_c7e7_49d2_5e2e_f073d37b48be["build()"]
  8c89b24d_db5b_dccf_7a0e_83cd57fdb81a -->|method| 57b36aa4_c7e7_49d2_5e2e_f073d37b48be

Relationship Graph

Source Code

drizzle-orm/src/pg-core/columns/char.ts lines 22–46

export class PgCharBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgChar'> & { length?: number | undefined }>
	extends PgColumnBuilder<
		T,
		{ length: T['length']; enumValues: T['enumValues'] },
		{ length: T['length'] }
	>
{
	static override readonly [entityKind]: string = 'PgCharBuilder';

	constructor(name: T['name'], config: PgCharConfig<T['enumValues'], T['length']>) {
		super(name, 'string', 'PgChar');
		this.config.length = config.length;
		this.config.enumValues = config.enum;
	}

	/** @internal */
	override build<TTableName extends string>(
		table: AnyPgTable<{ name: TTableName }>,
	): PgChar<MakeColumnConfig<T, TTableName> & { length: T['length'] }> {
		return new PgChar<MakeColumnConfig<T, TTableName> & { length: T['length'] }>(
			table,
			this.config as ColumnBuilderRuntimeConfig<any, any>,
		);
	}
}

Domain

Frequently Asked Questions

What is the PgCharBuilder class?
PgCharBuilder is a class in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/columns/char.ts.
Where is PgCharBuilder defined?
PgCharBuilder is defined in drizzle-orm/src/pg-core/columns/char.ts at line 22.

Analyze Your Own Codebase

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

Try Supermodel Free