Home / Function/ buildUpdateQuery() — drizzle-orm Function Reference

buildUpdateQuery() — drizzle-orm Function Reference

Architecture documentation for the buildUpdateQuery() function in dialect.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  675693c4_8831_5655_52c6_ac204a0b0346["buildUpdateQuery()"]
  1da3f399_3da2_55ff_342e_fb92de5e010c["SingleStoreDialect"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|defined in| 1da3f399_3da2_55ff_342e_fb92de5e010c
  4a664942_d2a4_176d_a746_ecda030d3d74["buildWithCTE()"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|calls| 4a664942_d2a4_176d_a746_ecda030d3d74
  ee86c4e3_48eb_8ec8_d0c7_76b611607d8f["buildUpdateSet()"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|calls| ee86c4e3_48eb_8ec8_d0c7_76b611607d8f
  625dcfbf_0612_f909_2143_34d4e88bb50c["buildSelection()"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|calls| 625dcfbf_0612_f909_2143_34d4e88bb50c
  20a80e8b_02c4_b4c7_180f_3bc7c4c5fc21["buildOrderBy()"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|calls| 20a80e8b_02c4_b4c7_180f_3bc7c4c5fc21
  27bb2127_ce03_aaf8_abe2_0189af2b27e5["buildLimit()"]
  675693c4_8831_5655_52c6_ac204a0b0346 -->|calls| 27bb2127_ce03_aaf8_abe2_0189af2b27e5
  style 675693c4_8831_5655_52c6_ac204a0b0346 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/singlestore-core/dialect.ts lines 157–173

	buildUpdateQuery({ table, set, where, returning, withList, limit, orderBy }: SingleStoreUpdateConfig): SQL {
		const withSql = this.buildWithCTE(withList);

		const setSql = this.buildUpdateSet(table, set);

		const returningSql = returning
			? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}`
			: undefined;

		const whereSql = where ? sql` where ${where}` : undefined;

		const orderBySql = this.buildOrderBy(orderBy);

		const limitSql = this.buildLimit(limit);

		return sql`${withSql}update ${table} set ${setSql}${whereSql}${orderBySql}${limitSql}${returningSql}`;
	}

Domain

Subdomains

Frequently Asked Questions

What does buildUpdateQuery() do?
buildUpdateQuery() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/singlestore-core/dialect.ts.
Where is buildUpdateQuery() defined?
buildUpdateQuery() is defined in drizzle-orm/src/singlestore-core/dialect.ts at line 157.
What does buildUpdateQuery() call?
buildUpdateQuery() calls 5 function(s): buildLimit, buildOrderBy, buildSelection, buildUpdateSet, buildWithCTE.

Analyze Your Own Codebase

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

Try Supermodel Free