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
  d0da4106_29e1_74dd_a559_e5c86bfd9ede["mock()"]
  64cae28a_b771_f862_2cb6_dd57589424be["index.ts"]
  d0da4106_29e1_74dd_a559_e5c86bfd9ede -->|defined in| 64cae28a_b771_f862_2cb6_dd57589424be
  b91dc682_fc28_2e61_4197_8c9918cec2d7["construct()"]
  d0da4106_29e1_74dd_a559_e5c86bfd9ede -->|calls| b91dc682_fc28_2e61_4197_8c9918cec2d7
  style d0da4106_29e1_74dd_a559_e5c86bfd9ede fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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