sql.ts — drizzle-orm Source File
Architecture documentation for sql.ts, a typescript file in the drizzle-orm codebase. 13 imports, 13 dependents.
Entity Profile
Dependency Diagram
graph LR 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a["sql.ts"] 7bd0ba6a_93b0_0df7_7f87_d1a726b246cb["column.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 7bd0ba6a_93b0_0df7_7f87_d1a726b246cb 48bb4797_1254_752d_d782_521f09c1a1d5["Column"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 48bb4797_1254_752d_d782_521f09c1a1d5 ddbb35ab_7e67_d2b6_96ec_1f37678fcb67["table.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> ddbb35ab_7e67_d2b6_96ec_1f37678fcb67 6f4580c8_dbd3_725b_5126_f06988ed43ab["Table"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 6f4580c8_dbd3_725b_5126_f06988ed43ab 84d0ea35_e4ab_0d94_802f_66e4bc7f77eb["Table"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 84d0ea35_e4ab_0d94_802f_66e4bc7f77eb 3766d874_812a_d152_3c15_0c39edd40b21["casing.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 3766d874_812a_d152_3c15_0c39edd40b21 27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 27705a9d_afe9_57dd_8c97_e52d8a67d426 6a45625c_59f3_c219_582e_6288284afe92["enum.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 6a45625c_59f3_c219_582e_6288284afe92 8fb028b7_6ce0_27fa_29b6_39545ba11529["select.types.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 8fb028b7_6ce0_27fa_29b6_39545ba11529 4d55618d_fa7b_8e54_edb2_b85ae393d95b["subquery.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 4d55618d_fa7b_8e54_edb2_b85ae393d95b 051cc2d2_fe6f_16df_aaec_3b341d2c2576["tracing.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> 051cc2d2_fe6f_16df_aaec_3b341d2c2576 ecce3253_1e75_a87f_27b3_ca87e81a3024["utils.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> ecce3253_1e75_a87f_27b3_ca87e81a3024 ed5a193e_7bfa_5e6a_c054_f843fbc50c51["view-common.ts"] 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a --> ed5a193e_7bfa_5e6a_c054_f843fbc50c51 ab181952_5759_c0bf_aeab_f255a140fe2a["alias.ts"] ab181952_5759_c0bf_aeab_f255a140fe2a --> 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a style 99347ab2_b1a1_faf4_e37c_7643e4b2eb8a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type { CasingCache } from '~/casing.ts';
import { entityKind, is } from '~/entity.ts';
import { isPgEnum } from '~/pg-core/columns/enum.ts';
import type { SelectResult } from '~/query-builders/select.types.ts';
import { Subquery } from '~/subquery.ts';
import { tracer } from '~/tracing.ts';
import type { Assume, Equal } from '~/utils.ts';
import { ViewBaseConfig } from '~/view-common.ts';
import type { AnyColumn } from '../column.ts';
import { Column } from '../column.ts';
import { IsAlias, Table } from '../table.ts';
/**
* This class is used to indicate a primitive param value that is used in `sql` tag.
* It is only used on type level and is never instantiated at runtime.
* If you see a value of this type in the code, its runtime value is actually the primitive param value.
*/
export class FakePrimitiveParam {
static readonly [entityKind]: string = 'FakePrimitiveParam';
}
export type Chunk =
| string
| Table
| View
| AnyColumn
| Name
| Param
| Placeholder
| SQL;
export interface BuildQueryConfig {
casing: CasingCache;
escapeName(name: string): string;
escapeParam(num: number, value: unknown): string;
escapeString(str: string): string;
prepareTyping?: (encoder: DriverValueEncoder<unknown, unknown>) => QueryTypingsValue;
paramStartIndex?: { value: number };
inlineParams?: boolean;
invokeSource?: 'indexes' | undefined;
}
export type QueryTypingsValue = 'json' | 'decimal' | 'time' | 'timestamp' | 'uuid' | 'date' | 'none';
export interface Query {
sql: string;
params: unknown[];
}
export interface QueryWithTypings extends Query {
typings?: QueryTypingsValue[];
}
/**
* Any value that implements the `getSQL` method. The implementations include:
* - `Table`
* - `Column`
* - `View`
* - `Subquery`
* - `SQL`
// ... (663 more lines)
Domain
Subdomains
Functions
Types
Dependencies
Imported By
- drizzle-orm/src/sql/functions/aggregate.ts
- drizzle-orm/src/alias.ts
- drizzle-orm/src/column-builder.ts
- drizzle-orm/src/column.ts
- drizzle-orm/src/sql/expressions/conditions.ts
- drizzle-orm/src/operations.ts
- drizzle-orm/src/relations.ts
- drizzle-orm/src/sql/expressions/select.ts
- drizzle-orm/src/selection-proxy.ts
- drizzle-orm/src/subquery.ts
- drizzle-orm/src/table.ts
- drizzle-orm/src/utils.ts
- drizzle-orm/src/sql/functions/vector.ts
Source
Frequently Asked Questions
What does sql.ts do?
sql.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 sql.ts?
sql.ts defines 19 function(s): QueryTypingsValue, empty, fillPlaceholders, fromList, getSQL, getViewName, identifier, isDriverValueEncoder, isSQLWrapper, isView, and 9 more.
What does sql.ts depend on?
sql.ts imports 13 module(s): Column, Table, Table, casing.ts, column.ts, entity.ts, enum.ts, select.types.ts, and 5 more.
What files import sql.ts?
sql.ts is imported by 13 file(s): aggregate.ts, alias.ts, column-builder.ts, column.ts, conditions.ts, operations.ts, relations.ts, select.ts, and 5 more.
Where is sql.ts in the architecture?
sql.ts is located at drizzle-orm/src/sql/sql.ts (domain: DrizzleORM, subdomain: SQLDialects, directory: drizzle-orm/src/sql).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free