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

mock() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a15fa4e1_c8c6_9807_0352_d2bf83af19c2["mock()"]
  7fb64832_5ba6_5927_364e_7c47bd7b41f0["index.ts"]
  a15fa4e1_c8c6_9807_0352_d2bf83af19c2 -->|defined in| 7fb64832_5ba6_5927_364e_7c47bd7b41f0
  b91dc682_fc28_2e61_4197_8c9918cec2d7["construct()"]
  a15fa4e1_c8c6_9807_0352_d2bf83af19c2 -->|calls| b91dc682_fc28_2e61_4197_8c9918cec2d7
  style a15fa4e1_c8c6_9807_0352_d2bf83af19c2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/libsql/http/index.ts lines 51–57

	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/http/index.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/libsql/http/index.ts at line 51.
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