smallint.ts — drizzle-orm Source File
Architecture documentation for smallint.ts, a typescript file in the drizzle-orm codebase. 7 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8["smallint.ts"] f4f42b4c_8610_03dd_fe01_232098668127["common.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> f4f42b4c_8610_03dd_fe01_232098668127 099d7c6d_2fc4_7b20_40e3_1b8af4138fe6["PgColumn"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 099d7c6d_2fc4_7b20_40e3_1b8af4138fe6 5e8f073a_0845_8d49_1d60_aeb1c020baaf["int.common.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 5e8f073a_0845_8d49_1d60_aeb1c020baaf 2dc784c6_95e9_4e28_ec81_7caf4acbd426["column-builder.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 2dc784c6_95e9_4e28_ec81_7caf4acbd426 05f0a280_d0c9_693a_a4bf_83cc671012d2["column.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 05f0a280_d0c9_693a_a4bf_83cc671012d2 27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 27705a9d_afe9_57dd_8c97_e52d8a67d426 17418917_ff81_c4e5_90f4_f37d557e5d51["table.ts"] 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 --> 17418917_ff81_c4e5_90f4_f37d557e5d51 b38cf654_48d6_41dc_6c0f_203697984d98["all.ts"] b38cf654_48d6_41dc_6c0f_203697984d98 --> 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 style 1efe7a66_e4ac_9b00_b7f9_c6b0047ae0f8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';
import type { ColumnBaseConfig } from '~/column.ts';
import { entityKind } from '~/entity.ts';
import type { AnyPgTable } from '~/pg-core/table.ts';
import { PgColumn } from './common.ts';
import { PgIntColumnBaseBuilder } from './int.common.ts';
export type PgSmallIntBuilderInitial<TName extends string> = PgSmallIntBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgSmallInt';
data: number;
driverParam: number | string;
enumValues: undefined;
}>;
export class PgSmallIntBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgSmallInt'>>
extends PgIntColumnBaseBuilder<T>
{
static override readonly [entityKind]: string = 'PgSmallIntBuilder';
constructor(name: T['name']) {
super(name, 'number', 'PgSmallInt');
}
/** @internal */
override build<TTableName extends string>(
table: AnyPgTable<{ name: TTableName }>,
): PgSmallInt<MakeColumnConfig<T, TTableName>> {
return new PgSmallInt<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);
}
}
export class PgSmallInt<T extends ColumnBaseConfig<'number', 'PgSmallInt'>> extends PgColumn<T> {
static override readonly [entityKind]: string = 'PgSmallInt';
getSQLType(): string {
return 'smallint';
}
override mapFromDriverValue = (value: number | string): number => {
if (typeof value === 'string') {
return Number(value);
}
return value;
};
}
export function smallint(): PgSmallIntBuilderInitial<''>;
export function smallint<TName extends string>(name: TName): PgSmallIntBuilderInitial<TName>;
export function smallint(name?: string) {
return new PgSmallIntBuilder(name ?? '');
}
Domain
Subdomains
Functions
Classes
Types
Dependencies
- PgColumn
- column-builder.ts
- column.ts
- common.ts
- entity.ts
- int.common.ts
- table.ts
Imported By
Source
Frequently Asked Questions
What does smallint.ts do?
smallint.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 smallint.ts?
smallint.ts defines 1 function(s): smallint.
What does smallint.ts depend on?
smallint.ts imports 7 module(s): PgColumn, column-builder.ts, column.ts, common.ts, entity.ts, int.common.ts, table.ts.
What files import smallint.ts?
smallint.ts is imported by 1 file(s): all.ts.
Where is smallint.ts in the architecture?
smallint.ts is located at drizzle-orm/src/pg-core/columns/smallint.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: drizzle-orm/src/pg-core/columns).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free