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

setOperationsUnionAllAsFunction() — drizzle-orm Function Reference

Architecture documentation for the setOperationsUnionAllAsFunction() function in index.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  206c347f_60ec_405d_a26f_a794e45c0ca6["setOperationsUnionAllAsFunction()"]
  34f01008_7c45_3804_1fad_b8b59cd8a413["MyDurableObject"]
  206c347f_60ec_405d_a26f_a794e45c0ca6 -->|defined in| 34f01008_7c45_3804_1fad_b8b59cd8a413
  7c7acbfe_6328_c8df_feba_552ee62a84d9["default.fetch()"]
  7c7acbfe_6328_c8df_feba_552ee62a84d9 -->|calls| 206c347f_60ec_405d_a26f_a794e45c0ca6
  b19b108f_def7_3a32_99a3_c8be51ce2fbf["beforeEach()"]
  206c347f_60ec_405d_a26f_a794e45c0ca6 -->|calls| b19b108f_def7_3a32_99a3_c8be51ce2fbf
  20636bd4_31a2_ed9f_3826_c7046d0ccd5e["setupSetOperationTest()"]
  206c347f_60ec_405d_a26f_a794e45c0ca6 -->|calls| 20636bd4_31a2_ed9f_3826_c7046d0ccd5e
  style 206c347f_60ec_405d_a26f_a794e45c0ca6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

integration-tests/tests/sqlite/durable-objects/index.ts lines 2767–2803

	async setOperationsUnionAllAsFunction(): Promise<void> {
		try {
			await this.beforeEach();
			await setupSetOperationTest(this.db);

			const result = unionAll(
				this.db.select({ id: citiesTable.id, name: citiesTable.name }).from(citiesTable).where(eq(citiesTable.id, 1)),
				this.db.select({ id: users2Table.id, name: users2Table.name }).from(users2Table).where(eq(users2Table.id, 1)),
				this.db.select({ id: users2Table.id, name: users2Table.name }).from(users2Table).where(eq(users2Table.id, 1)),
			).all();

			expect(result).length(3);

			expect(result).deep.equal([
				{ id: 1, name: 'New York' },
				{ id: 1, name: 'John' },
				{ id: 1, name: 'John' },
			]);

			expect(() => {
				unionAll(
					this.db
						.select({ id: citiesTable.id, name: citiesTable.name })
						.from(citiesTable).where(eq(citiesTable.id, 1)),
					this.db
						.select({ id: users2Table.id, name: users2Table.name })
						.from(users2Table).where(eq(users2Table.id, 1)),
					this.db
						.select({ name: users2Table.name, id: users2Table.id })
						.from(users2Table).where(eq(users2Table.id, 1)),
				).run();
			}).throw();
		} catch (error: any) {
			console.error(error);
			throw new Error(`setOperationsUnionAllAsFunction error`);
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does setOperationsUnionAllAsFunction() do?
setOperationsUnionAllAsFunction() is a function in the drizzle-orm codebase, defined in integration-tests/tests/sqlite/durable-objects/index.ts.
Where is setOperationsUnionAllAsFunction() defined?
setOperationsUnionAllAsFunction() is defined in integration-tests/tests/sqlite/durable-objects/index.ts at line 2767.
What does setOperationsUnionAllAsFunction() call?
setOperationsUnionAllAsFunction() calls 2 function(s): beforeEach, setupSetOperationTest.
What calls setOperationsUnionAllAsFunction()?
setOperationsUnionAllAsFunction() is called by 1 function(s): default.fetch.

Analyze Your Own Codebase

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

Try Supermodel Free