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

buildSetOperations() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  896a4bfc_a0fe_c924_90a8_862a42b92dd8["buildSetOperations()"]
  f80973ef_149c_bd36_66ee_1e7e9024a9d5["GelDialect"]
  896a4bfc_a0fe_c924_90a8_862a42b92dd8 -->|defined in| f80973ef_149c_bd36_66ee_1e7e9024a9d5
  6a5af19b_779e_e705_f0b0_c71ea6c700fd["buildSelectQuery()"]
  6a5af19b_779e_e705_f0b0_c71ea6c700fd -->|calls| 896a4bfc_a0fe_c924_90a8_862a42b92dd8
  a10eef6b_871f_2873_5f7a_35a4a094e933["buildSetOperationQuery()"]
  896a4bfc_a0fe_c924_90a8_862a42b92dd8 -->|calls| a10eef6b_871f_2873_5f7a_35a4a094e933
  style 896a4bfc_a0fe_c924_90a8_862a42b92dd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel-core/dialect.ts lines 445–461

	buildSetOperations(leftSelect: SQL, setOperators: GelSelectConfig['setOperators']): SQL {
		const [setOperator, ...rest] = setOperators;

		if (!setOperator) {
			throw new Error('Cannot pass undefined values to any set operator');
		}

		if (rest.length === 0) {
			return this.buildSetOperationQuery({ leftSelect, setOperator });
		}

		// Some recursive magic here
		return this.buildSetOperations(
			this.buildSetOperationQuery({ leftSelect, setOperator }),
			rest,
		);
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does buildSetOperations() do?
buildSetOperations() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel-core/dialect.ts.
Where is buildSetOperations() defined?
buildSetOperations() is defined in drizzle-orm/src/gel-core/dialect.ts at line 445.
What does buildSetOperations() call?
buildSetOperations() calls 1 function(s): buildSetOperationQuery.
What calls buildSetOperations()?
buildSetOperations() is called by 1 function(s): buildSelectQuery.

Analyze Your Own Codebase

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

Try Supermodel Free