Home / File/ column-builder.ts — drizzle-orm Source File

column-builder.ts — drizzle-orm Source File

Architecture documentation for column-builder.ts, a typescript file in the drizzle-orm codebase. 9 imports, 3 dependents.

File typescript DrizzleORM SQLDialects 9 imports 3 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  b1f62532_46b8_598e_816c_9da2dce0b761["column-builder.ts"]
  7bd0ba6a_93b0_0df7_7f87_d1a726b246cb["column.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 7bd0ba6a_93b0_0df7_7f87_d1a726b246cb
  cc2c5192_802c_1ca2_fed5_8a5bbb94e9a5["index.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> cc2c5192_802c_1ca2_fed5_8a5bbb94e9a5
  ba3533ff_2f7f_4c63_df5a_a1265c743dc0["index.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> ba3533ff_2f7f_4c63_df5a_a1265c743dc0
  02db9296_9e0d_5d40_9ae0_92fb990fb8e7["index.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 02db9296_9e0d_5d40_9ae0_92fb990fb8e7
  269d4e8a_34a8_0056_34bb_c3b0b1ff7e41["index.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 269d4e8a_34a8_0056_34bb_c3b0b1ff7e41
  99347ab2_b1a1_faf4_e37c_7643e4b2eb8a["sql.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a
  747a26aa_6cde_ad97_ffd0_707108092e72["index.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 747a26aa_6cde_ad97_ffd0_707108092e72
  99737bc3_a631_a054_9291_f966c791930f["utils.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 99737bc3_a631_a054_9291_f966c791930f
  27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"]
  b1f62532_46b8_598e_816c_9da2dce0b761 --> 27705a9d_afe9_57dd_8c97_e52d8a67d426
  a589b7ac_6c09_0a62_72ed_14847f3a5f40["batch.ts"]
  a589b7ac_6c09_0a62_72ed_14847f3a5f40 --> b1f62532_46b8_598e_816c_9da2dce0b761
  7bd0ba6a_93b0_0df7_7f87_d1a726b246cb["column.ts"]
  7bd0ba6a_93b0_0df7_7f87_d1a726b246cb --> b1f62532_46b8_598e_816c_9da2dce0b761
  b212032d_abb8_e0f8_406f_a94ad8600ccb["runnable-query.ts"]
  b212032d_abb8_e0f8_406f_a94ad8600ccb --> b1f62532_46b8_598e_816c_9da2dce0b761
  style b1f62532_46b8_598e_816c_9da2dce0b761 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { entityKind } from '~/entity.ts';
import type { Column } from './column.ts';
import type { GelColumn, GelExtraConfigColumn } from './gel-core/index.ts';
import type { MySqlColumn } from './mysql-core/index.ts';
import type { ExtraConfigColumn, PgColumn, PgSequenceOptions } from './pg-core/index.ts';
import type { SingleStoreColumn } from './singlestore-core/index.ts';
import type { SQL } from './sql/sql.ts';
import type { SQLiteColumn } from './sqlite-core/index.ts';
import type { Assume, Simplify } from './utils.ts';

export type ColumnDataType =
	| 'string'
	| 'number'
	| 'boolean'
	| 'array'
	| 'json'
	| 'date'
	| 'bigint'
	| 'custom'
	| 'buffer'
	| 'dateDuration'
	| 'duration'
	| 'relDuration'
	| 'localTime'
	| 'localDate'
	| 'localDateTime';

export type Dialect = 'pg' | 'mysql' | 'sqlite' | 'singlestore' | 'common' | 'gel';

export type GeneratedStorageMode = 'virtual' | 'stored';

export type GeneratedType = 'always' | 'byDefault';

export type GeneratedColumnConfig<TDataType> = {
	as: TDataType | SQL | (() => SQL);
	type?: GeneratedType;
	mode?: GeneratedStorageMode;
};

export type GeneratedIdentityConfig = {
	sequenceName?: string;
	sequenceOptions?: PgSequenceOptions;
	type: 'always' | 'byDefault';
};

export interface ColumnBuilderBaseConfig<TDataType extends ColumnDataType, TColumnType extends string> {
	name: string;
	dataType: TDataType;
	columnType: TColumnType;
	data: unknown;
	driverParam: unknown;
	enumValues: string[] | undefined;
}

export type MakeColumnConfig<
	T extends ColumnBuilderBaseConfig<ColumnDataType, string>,
	TTableName extends string,
	TData = T extends { $type: infer U } ? U : T['data'],
> = {
	name: T['name'];
// ... (357 more lines)

Domain

Subdomains

Functions

Frequently Asked Questions

What does column-builder.ts do?
column-builder.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 column-builder.ts?
column-builder.ts defines 2 function(s): SQL, TData.
What does column-builder.ts depend on?
column-builder.ts imports 9 module(s): column.ts, entity.ts, index.ts, index.ts, index.ts, index.ts, index.ts, sql.ts, and 1 more.
What files import column-builder.ts?
column-builder.ts is imported by 3 file(s): batch.ts, column.ts, runnable-query.ts.
Where is column-builder.ts in the architecture?
column-builder.ts is located at drizzle-orm/src/column-builder.ts (domain: DrizzleORM, subdomain: SQLDialects, directory: drizzle-orm/src).

Analyze Your Own Codebase

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

Try Supermodel Free