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

mock() — drizzle-orm Function Reference

Architecture documentation for the mock() function in driver.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  0a2636be_c131_7791_21cb_892645dbdf47["mock()"]
  0f0ec9c4_1c93_fe87_a305_092d4756cbda["driver.ts"]
  0a2636be_c131_7791_21cb_892645dbdf47 -->|defined in| 0f0ec9c4_1c93_fe87_a305_092d4756cbda
  42e7d306_17c9_7169_e16c_0f1e46bd2fb2["construct()"]
  0a2636be_c131_7791_21cb_892645dbdf47 -->|calls| 42e7d306_17c9_7169_e16c_0f1e46bd2fb2
  style 0a2636be_c131_7791_21cb_892645dbdf47 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/postgres-js/driver.ts lines 121–132

	export function mock<TSchema extends Record<string, unknown> = Record<string, never>>(
		config?: DrizzleConfig<TSchema>,
	): PostgresJsDatabase<TSchema> & {
		$client: '$client is not available on drizzle.mock()';
	} {
		return construct({
			options: {
				parsers: {},
				serializers: {},
			},
		} as any, config) as any;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does mock() do?
mock() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/postgres-js/driver.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/postgres-js/driver.ts at line 121.
What does mock() call?
mock() calls 1 function(s): construct.

Analyze Your Own Codebase

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

Try Supermodel Free