MCPcopy
hub / github.com/drizzle-team/drizzle-orm / get

Method get

drizzle-orm/src/cache/upstash/cache.ts:127–147  ·  view source on GitHub ↗
(
		key: string,
		tables: string[],
		isTag: boolean = false,
		isAutoInvalidate?: boolean,
	)

Source from the content-addressed store, hash-verified

125 }
126
127 override async get(
128 key: string,
129 tables: string[],
130 isTag: boolean = false,
131 isAutoInvalidate?: boolean,
132 ): Promise<any[] | undefined> {
133 if (!isAutoInvalidate) {
134 const result = await this.redis.hget(UpstashCache.nonAutoInvalidateTablePrefix, key);
135 return result === null ? undefined : result as any[];
136 }
137
138 if (isTag) {
139 const result = await this.luaScripts.getByTagScript.exec([UpstashCache.tagsMapKey], [key]);
140 return result === null ? undefined : result as any[];
141 }
142
143 // Normal cache lookup for the composite key
144 const compositeKey = this.getCompositeKey(tables);
145 const result = await this.redis.hget(compositeKey, key) ?? undefined; // Retrieve result for normal query
146 return result === null ? undefined : result as any[];
147 }
148
149 override async put(
150 key: string,

Callers

nothing calls this directly

Calls 1

execMethod · 0.80

Tested by

no test coverage detected