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
  32f43b83_6945_8409_625a_a92e1b5c9313["mock()"]
  053b47f2_f302_5369_9ab2_7667cbadf49f["driver.ts"]
  32f43b83_6945_8409_625a_a92e1b5c9313 -->|defined in| 053b47f2_f302_5369_9ab2_7667cbadf49f
  368e6c67_d9ba_9a79_058d_3e77198ecbf9["construct()"]
  32f43b83_6945_8409_625a_a92e1b5c9313 -->|calls| 368e6c67_d9ba_9a79_058d_3e77198ecbf9
  style 32f43b83_6945_8409_625a_a92e1b5c9313 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/bun-sql/driver.ts lines 114–125

	export function mock<TSchema extends Record<string, unknown> = Record<string, never>>(
		config?: DrizzleConfig<TSchema>,
	): BunSQLDatabase<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/bun-sql/driver.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/bun-sql/driver.ts at line 114.
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