Home / File/ update.ts — drizzle-orm Source File

update.ts — drizzle-orm Source File

Architecture documentation for update.ts, a typescript file in the drizzle-orm codebase. 19 imports, 1 dependents.

File typescript DrizzleORM QueryBuilders 19 imports 1 dependents 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  57f9cbc9_c42c_25c4_0f2c_f774522cf533["update.ts"]
  947c2a21_2733_ac33_15d3_861495610042["common.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 947c2a21_2733_ac33_15d3_861495610042
  0f5db9ee_3497_170d_35c2_f74855a5ab79["utils.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 0f5db9ee_3497_170d_35c2_f74855a5ab79
  4f2033cb_d1d9_85a9_3031_94db6dda7b53["extractUsedTable"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 4f2033cb_d1d9_85a9_3031_94db6dda7b53
  26733dc3_2526_d934_b51f_2180550e97d3["view-base.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 26733dc3_2526_d934_b51f_2180550e97d3
  a9c846a6_c368_b809_91cb_297f9f44bb0f["select.types.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> a9c846a6_c368_b809_91cb_297f9f44bb0f
  52cabd36_d0c9_d018_35bc_6856fc89d73f["column.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 52cabd36_d0c9_d018_35bc_6856fc89d73f
  9347c3af_060d_bd99_cd17_d7f17fadf7cb["entity.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 9347c3af_060d_bd99_cd17_d7f17fadf7cb
  56ffaf86_1cb8_3acf_35e7_8c26940f5feb["select.types.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 56ffaf86_1cb8_3acf_35e7_8c26940f5feb
  a26eda38_77d1_1f0a_1f46_2f5a23c36fa9["query-promise.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> a26eda38_77d1_1f0a_1f46_2f5a23c36fa9
  6c451d43_58e9_7a8c_efb8_3f8677679a7a["runnable-query.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 6c451d43_58e9_7a8c_efb8_3f8677679a7a
  14d8e7a8_cf89_3f16_87e5_bd0c924ebb66["selection-proxy.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 14d8e7a8_cf89_3f16_87e5_bd0c924ebb66
  163f3669_76fd_05ca_2197_16086705de4a["sql.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 163f3669_76fd_05ca_2197_16086705de4a
  3d8dc2e6_fcf8_1ed2_c898_ebd3b58d7e1f["dialect.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 3d8dc2e6_fcf8_1ed2_c898_ebd3b58d7e1f
  1d649cd1_4560_4dca_b719_7ca34f6d3b32["session.ts"]
  57f9cbc9_c42c_25c4_0f2c_f774522cf533 --> 1d649cd1_4560_4dca_b719_7ca34f6d3b32
  style 57f9cbc9_c42c_25c4_0f2c_f774522cf533 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { GetColumnData } from '~/column.ts';
import { entityKind, is } from '~/entity.ts';
import type { JoinType, SelectResultFields } from '~/query-builders/select.types.ts';
import { QueryPromise } from '~/query-promise.ts';
import type { RunnableQuery } from '~/runnable-query.ts';
import { SelectionProxyHandler } from '~/selection-proxy.ts';
import type { Placeholder, Query, SQL, SQLWrapper } from '~/sql/sql.ts';
import type { SQLiteDialect } from '~/sqlite-core/dialect.ts';
import type { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts';
import { SQLiteTable } from '~/sqlite-core/table.ts';
import { Subquery } from '~/subquery.ts';
import { Table } from '~/table.ts';
import {
	type DrizzleTypeError,
	getTableLikeName,
	mapUpdateSet,
	orderSelectedFields,
	type UpdateSet,
	type ValueOrArray,
} from '~/utils.ts';
import { ViewBaseConfig } from '~/view-common.ts';
import type { SQLiteColumn } from '../columns/common.ts';
import { extractUsedTable } from '../utils.ts';
import { SQLiteViewBase } from '../view-base.ts';
import type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from './select.types.ts';

export interface SQLiteUpdateConfig {
	where?: SQL | undefined;
	limit?: number | Placeholder;
	orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];
	set: UpdateSet;
	table: SQLiteTable;
	from?: SQLiteTable | Subquery | SQLiteViewBase | SQL;
	joins: SQLiteSelectJoinConfig[];
	returning?: SelectedFieldsOrdered;
	withList?: Subquery[];
}

export type SQLiteUpdateSetSource<TTable extends SQLiteTable> =
	& {
		[Key in keyof TTable['$inferInsert']]?:
			| GetColumnData<TTable['_']['columns'][Key], 'query'>
			| SQL
			| SQLiteColumn
			| undefined;
	}
	& {};

export class SQLiteUpdateBuilder<
	TTable extends SQLiteTable,
	TResultType extends 'sync' | 'async',
	TRunResult,
> {
	static readonly [entityKind]: string = 'SQLiteUpdateBuilder';

	declare readonly _: {
		readonly table: TTable;
	};

	constructor(
// ... (406 more lines)

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does update.ts do?
update.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, QueryBuilders subdomain.
What functions are defined in update.ts?
update.ts defines 1 function(s): T.
What does update.ts depend on?
update.ts imports 19 module(s): column.ts, common.ts, dialect.ts, entity.ts, extractUsedTable, query-promise.ts, runnable-query.ts, select.types.ts, and 11 more.
What files import update.ts?
update.ts is imported by 1 file(s): insert.ts.
Where is update.ts in the architecture?
update.ts is located at drizzle-orm/src/sqlite-core/query-builders/update.ts (domain: DrizzleORM, subdomain: QueryBuilders, directory: drizzle-orm/src/sqlite-core/query-builders).

Analyze Your Own Codebase

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

Try Supermodel Free