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 6cdccc31_b9f0_91e5_09b4_cd9c682323e9["mock()"] 53702de1_49d7_f27f_696b_4103d414417d["driver.ts"] 6cdccc31_b9f0_91e5_09b4_cd9c682323e9 -->|defined in| 53702de1_49d7_f27f_696b_4103d414417d 53fe8589_37a4_1206_812e_4e321d233cee["construct()"] 6cdccc31_b9f0_91e5_09b4_cd9c682323e9 -->|calls| 53fe8589_37a4_1206_812e_4e321d233cee style 6cdccc31_b9f0_91e5_09b4_cd9c682323e9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/pglite/driver.ts lines 154–160
export function mock<TSchema extends Record<string, unknown> = Record<string, never>>(
config?: DrizzleConfig<TSchema>,
): PgliteDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
} {
return construct({} as any, config) as any;
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does mock() do?
mock() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/pglite/driver.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/pglite/driver.ts at line 154.
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