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

mapGetResult() — drizzle-orm Function Reference

Architecture documentation for the mapGetResult() function in session.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  fc299b5b_b02d_ff84_c29f_41dab0f8c97f["mapGetResult()"]
  40aea31b_a504_408a_306d_c180ac0ece23["D1PreparedQuery"]
  fc299b5b_b02d_ff84_c29f_41dab0f8c97f -->|defined in| 40aea31b_a504_408a_306d_c180ac0ece23
  90a859fb_1459_4864_549d_4a787541ca42["d1ToRawMapping()"]
  fc299b5b_b02d_ff84_c29f_41dab0f8c97f -->|calls| 90a859fb_1459_4864_549d_4a787541ca42
  style fc299b5b_b02d_ff84_c29f_41dab0f8c97f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/d1/session.ts lines 261–275

	override mapGetResult(result: unknown, isFromBatch?: boolean): unknown {
		if (isFromBatch) {
			result = d1ToRawMapping((result as D1Result).results)[0];
		}

		if (!this.fields && !this.customResultMapper) {
			return result;
		}

		if (this.customResultMapper) {
			return this.customResultMapper([result as unknown[]]) as T['all'];
		}

		return mapResultRow(this.fields!, result as unknown[], this.joinsNotNullableMap);
	}

Domain

Subdomains

Frequently Asked Questions

What does mapGetResult() do?
mapGetResult() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/d1/session.ts.
Where is mapGetResult() defined?
mapGetResult() is defined in drizzle-orm/src/d1/session.ts at line 261.
What does mapGetResult() call?
mapGetResult() calls 1 function(s): d1ToRawMapping.

Analyze Your Own Codebase

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

Try Supermodel Free