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

query() — drizzle-orm Function Reference

Architecture documentation for the query() function in pg-proxy.test.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  22a61306_0206_917b_93a8_5c98e4450612["query()"]
  a76e119d_67cc_b66d_db8c_6162a7e33fe9["ServerSimulator"]
  22a61306_0206_917b_93a8_5c98e4450612 -->|defined in| a76e119d_67cc_b66d_db8c_6162a7e33fe9
  6ee33c4f_1a80_6e91_70bd_a9d7c04d0e79["migrations()"]
  6ee33c4f_1a80_6e91_70bd_a9d7c04d0e79 -->|calls| 22a61306_0206_917b_93a8_5c98e4450612
  style 22a61306_0206_917b_93a8_5c98e4450612 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

integration-tests/tests/pg/pg-proxy.test.ts lines 29–56

	async query(sql: string, params: any[], method: 'all' | 'execute') {
		if (method === 'all') {
			try {
				const result = await this.db.query({
					text: sql,
					values: params,
					rowMode: 'array',
				});

				return { data: result.rows as any };
			} catch (e: any) {
				return { error: e };
			}
		} else if (method === 'execute') {
			try {
				const result = await this.db.query({
					text: sql,
					values: params,
				});

				return { data: result.rows as any };
			} catch (e: any) {
				return { error: e };
			}
		} else {
			return { error: 'Unknown method value' };
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does query() do?
query() is a function in the drizzle-orm codebase, defined in integration-tests/tests/pg/pg-proxy.test.ts.
Where is query() defined?
query() is defined in integration-tests/tests/pg/pg-proxy.test.ts at line 29.
What calls query()?
query() is called by 1 function(s): migrations.

Analyze Your Own Codebase

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

Try Supermodel Free