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

mapFromDriverValue() — drizzle-orm Function Reference

Architecture documentation for the mapFromDriverValue() function in timestamp.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  13d1ea24_6f54_9a64_be6b_382bf562c583["mapFromDriverValue()"]
  5dafd4db_e70f_41bc_554b_872fae3209da["PgTimestampString"]
  13d1ea24_6f54_9a64_be6b_382bf562c583 -->|defined in| 5dafd4db_e70f_41bc_554b_872fae3209da
  ead8b67b_9f9a_d8f2_9aba_6c01eed36aad["mapFromDriverValue()"]
  ead8b67b_9f9a_d8f2_9aba_6c01eed36aad -->|calls| 13d1ea24_6f54_9a64_be6b_382bf562c583
  ead8b67b_9f9a_d8f2_9aba_6c01eed36aad["mapFromDriverValue()"]
  13d1ea24_6f54_9a64_be6b_382bf562c583 -->|calls| ead8b67b_9f9a_d8f2_9aba_6c01eed36aad
  style 13d1ea24_6f54_9a64_be6b_382bf562c583 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/pg-core/columns/timestamp.ts lines 127–138

	override mapFromDriverValue(value: Date | string): string {
		if (typeof value === 'string') return value;

		const shortened = value.toISOString().slice(0, -1).replace('T', ' ');
		if (this.withTimezone) {
			const offset = value.getTimezoneOffset();
			const sign = offset <= 0 ? '+' : '-';
			return `${shortened}${sign}${Math.floor(Math.abs(offset) / 60).toString().padStart(2, '0')}`;
		}

		return shortened;
	}

Domain

Subdomains

Frequently Asked Questions

What does mapFromDriverValue() do?
mapFromDriverValue() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/pg-core/columns/timestamp.ts.
Where is mapFromDriverValue() defined?
mapFromDriverValue() is defined in drizzle-orm/src/pg-core/columns/timestamp.ts at line 127.
What does mapFromDriverValue() call?
mapFromDriverValue() calls 1 function(s): mapFromDriverValue.
What calls mapFromDriverValue()?
mapFromDriverValue() is called by 1 function(s): mapFromDriverValue.

Analyze Your Own Codebase

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

Try Supermodel Free