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
  6c0ce719_e450_fb6a_8c10_cd3c28ecb9f5["$withCache()"]
  6fe5c70d_acdd_5534_3d21_880cc50d4871["SingleStoreSelectBase"]
  6c0ce719_e450_fb6a_8c10_cd3c28ecb9f5 -->|defined in| 6fe5c70d_acdd_5534_3d21_880cc50d4871
  style 6c0ce719_e450_fb6a_8c10_cd3c28ecb9f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/singlestore-core/query-builders/select.ts lines 1006–1013

	$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/singlestore-core/query-builders/select.ts.
Where is $withCache() defined?
$withCache() is defined in drizzle-orm/src/singlestore-core/query-builders/select.ts at line 1006.

Analyze Your Own Codebase

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

Try Supermodel Free