text.ts — drizzle-orm Source File
Architecture documentation for text.ts, a typescript file in the drizzle-orm codebase. 6 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 08f1f69b_2d74_a054_bf7f_31e92d6e16e8["text.ts"] 835b37b8_5537_93b3_6081_c47371e60b11["common.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> 835b37b8_5537_93b3_6081_c47371e60b11 2dc784c6_95e9_4e28_ec81_7caf4acbd426["column-builder.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> 2dc784c6_95e9_4e28_ec81_7caf4acbd426 05f0a280_d0c9_693a_a4bf_83cc671012d2["column.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> 05f0a280_d0c9_693a_a4bf_83cc671012d2 27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> 27705a9d_afe9_57dd_8c97_e52d8a67d426 744f5864_8de4_6d1f_dcfc_5ef4ae408c9a["table.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> 744f5864_8de4_6d1f_dcfc_5ef4ae408c9a ecce3253_1e75_a87f_27b3_ca87e81a3024["utils.ts"] 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 --> ecce3253_1e75_a87f_27b3_ca87e81a3024 a70c1ec7_29ee_10ca_2b05_4be0c246a540["all.ts"] a70c1ec7_29ee_10ca_2b05_4be0c246a540 --> 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 style 08f1f69b_2d74_a054_bf7f_31e92d6e16e8 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 { AnySingleStoreTable } from '~/singlestore-core/table.ts';
import { getColumnNameAndConfig, type Writable } from '~/utils.ts';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';
export type SingleStoreTextColumnType = 'tinytext' | 'text' | 'mediumtext' | 'longtext';
export type SingleStoreTextBuilderInitial<TName extends string, TEnum extends [string, ...string[]]> =
SingleStoreTextBuilder<{
name: TName;
dataType: 'string';
columnType: 'SingleStoreText';
data: TEnum[number];
driverParam: string;
enumValues: TEnum;
generated: undefined;
}>;
export class SingleStoreTextBuilder<T extends ColumnBuilderBaseConfig<'string', 'SingleStoreText'>>
extends SingleStoreColumnBuilder<
T,
{ textType: SingleStoreTextColumnType; enumValues: T['enumValues'] }
>
{
static override readonly [entityKind]: string = 'SingleStoreTextBuilder';
constructor(name: T['name'], textType: SingleStoreTextColumnType, config: SingleStoreTextConfig<T['enumValues']>) {
super(name, 'string', 'SingleStoreText');
this.config.textType = textType;
this.config.enumValues = config.enum;
}
/** @internal */
override build<TTableName extends string>(
table: AnySingleStoreTable<{ name: TTableName }>,
): SingleStoreText<MakeColumnConfig<T, TTableName>> {
return new SingleStoreText<MakeColumnConfig<T, TTableName>>(
table,
this.config as ColumnBuilderRuntimeConfig<any, any>,
);
}
}
export class SingleStoreText<T extends ColumnBaseConfig<'string', 'SingleStoreText'>>
extends SingleStoreColumn<T, { textType: SingleStoreTextColumnType; enumValues: T['enumValues'] }>
{
static override readonly [entityKind]: string = 'SingleStoreText';
readonly textType: SingleStoreTextColumnType = this.config.textType;
override readonly enumValues = this.config.enumValues;
getSQLType(): string {
return this.textType;
}
}
export interface SingleStoreTextConfig<
TEnum extends readonly string[] | string[] | undefined = readonly string[] | string[] | undefined,
> {
enum?: TEnum;
}
export function text(): SingleStoreTextBuilderInitial<'', [string, ...string[]]>;
export function text<U extends string, T extends Readonly<[U, ...U[]]>>(
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<'', Writable<T>>;
export function text<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(
name: TName,
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<TName, Writable<T>>;
export function text(a?: string | SingleStoreTextConfig, b: SingleStoreTextConfig = {}): any {
const { name, config } = getColumnNameAndConfig<SingleStoreTextConfig>(a, b);
return new SingleStoreTextBuilder(name, 'text', config as any);
}
export function tinytext(): SingleStoreTextBuilderInitial<'', [string, ...string[]]>;
export function tinytext<U extends string, T extends Readonly<[U, ...U[]]>>(
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<'', Writable<T>>;
export function tinytext<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(
name: TName,
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<TName, Writable<T>>;
export function tinytext(a?: string | SingleStoreTextConfig, b: SingleStoreTextConfig = {}): any {
const { name, config } = getColumnNameAndConfig<SingleStoreTextConfig>(a, b);
return new SingleStoreTextBuilder(name, 'tinytext', config as any);
}
export function mediumtext(): SingleStoreTextBuilderInitial<'', [string, ...string[]]>;
export function mediumtext<U extends string, T extends Readonly<[U, ...U[]]>>(
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<'', Writable<T>>;
export function mediumtext<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(
name: TName,
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<TName, Writable<T>>;
export function mediumtext(a?: string | SingleStoreTextConfig, b: SingleStoreTextConfig = {}): any {
const { name, config } = getColumnNameAndConfig<SingleStoreTextConfig>(a, b);
return new SingleStoreTextBuilder(name, 'mediumtext', config as any);
}
export function longtext(): SingleStoreTextBuilderInitial<'', [string, ...string[]]>;
export function longtext<U extends string, T extends Readonly<[U, ...U[]]>>(
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<'', Writable<T>>;
export function longtext<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(
name: TName,
config?: SingleStoreTextConfig<T | Writable<T>>,
): SingleStoreTextBuilderInitial<TName, Writable<T>>;
export function longtext(a?: string | SingleStoreTextConfig, b: SingleStoreTextConfig = {}): any {
const { name, config } = getColumnNameAndConfig<SingleStoreTextConfig>(a, b);
return new SingleStoreTextBuilder(name, 'longtext', config as any);
}
Domain
Subdomains
Functions
Dependencies
- column-builder.ts
- column.ts
- common.ts
- entity.ts
- table.ts
- utils.ts
Imported By
Source
Frequently Asked Questions
What does text.ts do?
text.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 text.ts?
text.ts defines 4 function(s): longtext, mediumtext, text, tinytext.
What does text.ts depend on?
text.ts imports 6 module(s): column-builder.ts, column.ts, common.ts, entity.ts, table.ts, utils.ts.
What files import text.ts?
text.ts is imported by 1 file(s): all.ts.
Where is text.ts in the architecture?
text.ts is located at drizzle-orm/src/singlestore-core/columns/text.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: drizzle-orm/src/singlestore-core/columns).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free