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
  02c498f5_5e4a_e2b3_5857_bd64a5bd2d59["mock()"]
  31b4414e_8263_88ee_640d_ad9fb5a46759["driver.ts"]
  02c498f5_5e4a_e2b3_5857_bd64a5bd2d59 -->|defined in| 31b4414e_8263_88ee_640d_ad9fb5a46759
  b91dc682_fc28_2e61_4197_8c9918cec2d7["construct()"]
  02c498f5_5e4a_e2b3_5857_bd64a5bd2d59 -->|calls| b91dc682_fc28_2e61_4197_8c9918cec2d7
  style 02c498f5_5e4a_e2b3_5857_bd64a5bd2d59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/libsql/driver.ts lines 53–59

	export function mock<TSchema extends Record<string, unknown> = Record<string, never>>(
		config?: DrizzleConfig<TSchema>,
	): LibSQLDatabase<TSchema> & {
		$client: '$client is not available on drizzle.mock()';
	} {
		return construct({} 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/libsql/driver.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/libsql/driver.ts at line 53.
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