onMutate() — drizzle-orm Function Reference
Architecture documentation for the onMutate() function in singlestore-cache.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 6abed97f_be94_27e5_491f_eeca6b84e3cb["onMutate()"] 58fc1702_28d9_32ba_a090_d4044bb1b841["TestGlobalCache"] 6abed97f_be94_27e5_491f_eeca6b84e3cb -->|defined in| 58fc1702_28d9_32ba_a090_d4044bb1b841 style 6abed97f_be94_27e5_491f_eeca6b84e3cb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
integration-tests/tests/singlestore/singlestore-cache.ts lines 52–77
override async onMutate(params: MutationOption): Promise<void> {
const tagsArray = params.tags ? Array.isArray(params.tags) ? params.tags : [params.tags] : [];
const tablesArray = params.tables ? Array.isArray(params.tables) ? params.tables : [params.tables] : [];
const keysToDelete = new Set<string>();
for (const table of tablesArray) {
const tableName = is(table, Table) ? getTableName(table) : table as string;
const keys = this.usedTablesPerKey[tableName] ?? [];
for (const key of keys) keysToDelete.add(key);
}
if (keysToDelete.size > 0 || tagsArray.length > 0) {
for (const tag of tagsArray) {
await this.kv.delete(tag);
}
for (const key of keysToDelete) {
await this.kv.delete(key);
for (const table of tablesArray) {
const tableName = is(table, Table) ? getTableName(table) : table as string;
this.usedTablesPerKey[tableName] = [];
}
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does onMutate() do?
onMutate() is a function in the drizzle-orm codebase, defined in integration-tests/tests/singlestore/singlestore-cache.ts.
Where is onMutate() defined?
onMutate() is defined in integration-tests/tests/singlestore/singlestore-cache.ts at line 52.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free