Home / File/ int.common.ts — drizzle-orm Source File

int.common.ts — drizzle-orm Source File

Architecture documentation for int.common.ts, a typescript file in the drizzle-orm codebase. 4 imports, 4 dependents.

File typescript DrizzleORM 4 imports 4 dependents

Entity Profile

Dependency Diagram

graph LR
  5fdca641_932c_bf0c_9007_2ff637d9c705["int.common.ts"]
  37aabffb_158c_feb8_20e6_26334698593c["sequence.ts"]
  5fdca641_932c_bf0c_9007_2ff637d9c705 --> 37aabffb_158c_feb8_20e6_26334698593c
  a74dd48d_d5e3_6bb4_19c7_1954c9126816["common.ts"]
  5fdca641_932c_bf0c_9007_2ff637d9c705 --> a74dd48d_d5e3_6bb4_19c7_1954c9126816
  2dc784c6_95e9_4e28_ec81_7caf4acbd426["column-builder.ts"]
  5fdca641_932c_bf0c_9007_2ff637d9c705 --> 2dc784c6_95e9_4e28_ec81_7caf4acbd426
  27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"]
  5fdca641_932c_bf0c_9007_2ff637d9c705 --> 27705a9d_afe9_57dd_8c97_e52d8a67d426
  62bbdf4d_cbc6_bb65_8d8d_d1a9807ab620["bigint.ts"]
  62bbdf4d_cbc6_bb65_8d8d_d1a9807ab620 --> 5fdca641_932c_bf0c_9007_2ff637d9c705
  e5c9b8ef_d760_345f_c691_226de7d20135["bigintT.ts"]
  e5c9b8ef_d760_345f_c691_226de7d20135 --> 5fdca641_932c_bf0c_9007_2ff637d9c705
  3d18c98f_d49f_8657_6406_ff20d7800986["integer.ts"]
  3d18c98f_d49f_8657_6406_ff20d7800986 --> 5fdca641_932c_bf0c_9007_2ff637d9c705
  41fc1c2f_5284_10b7_6f35_bd5efb077dfe["smallint.ts"]
  41fc1c2f_5284_10b7_6f35_bd5efb077dfe --> 5fdca641_932c_bf0c_9007_2ff637d9c705
  style 5fdca641_932c_bf0c_9007_2ff637d9c705 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { ColumnBuilderBaseConfig, ColumnDataType, GeneratedIdentityConfig, IsIdentity } from '~/column-builder.ts';
import { entityKind } from '~/entity.ts';
import type { GelSequenceOptions } from '../sequence.ts';
import { GelColumnBuilder } from './common.ts';

export abstract class GelIntColumnBaseBuilder<
	T extends ColumnBuilderBaseConfig<ColumnDataType, string>,
> extends GelColumnBuilder<
	T,
	{ generatedIdentity: GeneratedIdentityConfig }
> {
	static override readonly [entityKind]: string = 'GelIntColumnBaseBuilder';

	generatedAlwaysAsIdentity(
		sequence?: GelSequenceOptions & { name?: string },
	): IsIdentity<this, 'always'> {
		if (sequence) {
			const { name, ...options } = sequence;
			this.config.generatedIdentity = {
				type: 'always',
				sequenceName: name,
				sequenceOptions: options,
			};
		} else {
			this.config.generatedIdentity = {
				type: 'always',
			};
		}

		this.config.hasDefault = true;
		this.config.notNull = true;

		return this as IsIdentity<this, 'always'>;
	}

	generatedByDefaultAsIdentity(
		sequence?: GelSequenceOptions & { name?: string },
	): IsIdentity<this, 'byDefault'> {
		if (sequence) {
			const { name, ...options } = sequence;
			this.config.generatedIdentity = {
				type: 'byDefault',
				sequenceName: name,
				sequenceOptions: options,
			};
		} else {
			this.config.generatedIdentity = {
				type: 'byDefault',
			};
		}

		this.config.hasDefault = true;
		this.config.notNull = true;

		return this as IsIdentity<this, 'byDefault'>;
	}
}

Domain

Dependencies

Frequently Asked Questions

What does int.common.ts do?
int.common.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain.
What does int.common.ts depend on?
int.common.ts imports 4 module(s): column-builder.ts, common.ts, entity.ts, sequence.ts.
What files import int.common.ts?
int.common.ts is imported by 4 file(s): bigint.ts, bigintT.ts, integer.ts, smallint.ts.
Where is int.common.ts in the architecture?
int.common.ts is located at drizzle-orm/src/gel-core/columns/int.common.ts (domain: DrizzleORM, directory: drizzle-orm/src/gel-core/columns).

Analyze Your Own Codebase

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

Try Supermodel Free