Home / Function/ $withCache() — drizzle-orm Function Reference

$withCache() — drizzle-orm Function Reference

Architecture documentation for the $withCache() function in select.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  a372da76_05f9_c078_ba96_50b887703529["$withCache()"]
  7bebbd50_10c8_bbd4_74e2_111a51da2257["GelSelectBase"]
  a372da76_05f9_c078_ba96_50b887703529 -->|defined in| 7bebbd50_10c8_bbd4_74e2_111a51da2257
  style a372da76_05f9_c078_ba96_50b887703529 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel-core/query-builders/select.ts lines 1082–1089

	$withCache(config?: { config?: CacheConfig; tag?: string; autoInvalidate?: boolean } | false) {
		this.cacheConfig = config === undefined
			? { config: {}, enable: true, autoInvalidate: true }
			: config === false
			? { enable: false }
			: { enable: true, autoInvalidate: true, ...config };
		return this;
	}

Domain

Subdomains

Frequently Asked Questions

What does $withCache() do?
$withCache() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel-core/query-builders/select.ts.
Where is $withCache() defined?
$withCache() is defined in drizzle-orm/src/gel-core/query-builders/select.ts at line 1082.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free