@prisma/orm-extension-middleware-cache 8.0.0-rc.17-dev.26 → 8.0.0-rc.17-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -112,4 +112,4 @@ A tag scheme is a store policy: `cacheAnnotation({ meta: { tags: ['users'] } })`
112
112
 
113
113
  The middleware is a read-through cache with a control surface: keys and `deriveKey`, `meta`, `bypass`, `invalidate`, and the `CacheStore` interface. It carries data between the annotations and the store and never interprets it. Lifetime and the meaning of `meta` are the store's; deciding what to invalidate and when, request coalescing and routing between several stores belong in extensions built on these primitives.
114
114
 
115
- Invalidating as part of a write is not supported yet: it must wait for the transaction to commit, including the transactions the ORM opens for its own `update()` and `delete()`, and the runtime has no post-commit hook. Until then, call `invalidate` after the write returns. Serve-stale strategies such as stale-while-revalidate need the hit-or-miss decision, which only the middleware makes.
115
+ Invalidating as part of a write is not supported yet: it must wait for the transaction to commit, including the transactions the ORM opens for its own `update()` and `delete()`, and the middleware does not yet act on `activityFinalized`, the event that fires once a write has committed. Until then, call `invalidate` after the write returns. Serve-stale strategies such as stale-while-revalidate need the hit-or-miss decision, which only the middleware makes.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnnotationHandle, AnnotationValue, CrossFamilyMiddleware, ExecutionPlan, RuntimeMiddlewareContext } from "@prisma/orm-framework/components/runtime";
1
+ import { ActivityContext, AnnotationHandle, AnnotationValue, CrossFamilyMiddleware, ExecutionPlan } from "@prisma/orm-framework/components/runtime";
2
2
  //#region ../../../3-extensions/middleware-cache/dist/index.d.mts
3
3
  //#region src/cache-annotation.d.ts
4
4
  /**
@@ -165,7 +165,7 @@ declare function createInMemoryCacheStore<TMeta = unknown, TValue = CachedRows>(
165
165
  */
166
166
  interface CacheMiddlewareOptions<TMeta = unknown> {
167
167
  readonly store?: CacheStore<TMeta, CachedRows>;
168
- readonly deriveKey?: (exec: ExecutionPlan, ctx: RuntimeMiddlewareContext) => string | Promise<string>;
168
+ readonly deriveKey?: (exec: ExecutionPlan, ctx: ActivityContext) => string | Promise<string>;
169
169
  }
170
170
  /**
171
171
  * The cache middleware.
@@ -188,7 +188,7 @@ type CacheMiddleware<TMeta = unknown> = CrossFamilyMiddleware & {
188
188
  * The default `deriveKey`: the family runtime's content hash of the plan, which covers the
189
189
  * statement, its parameters and the storage hash.
190
190
  */
191
- declare function deriveKeyFromContentHash(exec: ExecutionPlan, ctx: RuntimeMiddlewareContext): Promise<string>;
191
+ declare function deriveKeyFromContentHash(exec: ExecutionPlan, ctx: ActivityContext): Promise<string>;
192
192
  /**
193
193
  * Creates a read-through cache middleware that works with every family runtime.
194
194
  *
@@ -196,10 +196,10 @@ declare function deriveKeyFromContentHash(exec: ExecutionPlan, ctx: RuntimeMiddl
196
196
  * `bypass`, and the read runs in runtime scope (not inside a connection or transaction). The key
197
197
  * is the annotation's `key`, else `deriveKey(exec, ctx)`.
198
198
  *
199
- * - `interceptQuery` — on a hit, returns the stored rows and the driver does not run. On a miss,
200
- * starts collecting rows.
199
+ * - `intercept.onQuery` — on a hit, returns the stored rows and the driver does not run. On a
200
+ * miss, starts collecting rows.
201
201
  * - `onRow` — collects each row of a miss.
202
- * - `afterQuery` — when the driver completed the read, calls `store.set(entry, rows)` with the
202
+ * - `activityEnded` — when the driver completed the read, calls `store.set(entry, rows)` with the
203
203
  * entry `store.get` returned, which stores only if the key's version has not moved. If an
204
204
  * `unset` moved it meanwhile, `set` returns `false` and the middleware logs
205
205
  * `middleware.cache.store-skipped`.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../3-extensions/middleware-cache/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;UAcU,uBAAuB;WACtB;WACA,OAAO;WACP;;;;;;KAMN,0BAA0B,iBAAiB,SAAS,uBAAuB,WAAW,gBAAgB;WAChG;WACA,cAAc;WACd,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACb,QAAQ,WAAW,OAAO;EAC9B,IAAI,OAAO,WAAW,OAAO,SAAS,OAAO,SAAS;EACtD,MAAM;aACK;aACA,MAAM;MACb;;;;;;;;;;;;;;;UAeI;WACC;WACA;WACA;;;;;;;;;iBASM,yBAAyB,iBAAiB,SAAS,YAAY,UAAU,4BAA4B,WAAW,OAAO;;;;;;;;;;;;;;;UAe9H,uBAAuB;WACtB,QAAQ,WAAW,OAAO;WAC1B,aAAa,MAAM,eAAe,KAAK,6BAA6B;;;;;;;;;;;;;KAa1E,gBAAgB,mBAAmB;WAC7B,aAAa;aACX;aACA,OAAO;QACZ;;;;;;iBAMS,yBAAyB,MAAM,eAAe,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BrE,sBAAsB,iBAAiB,UAAU,uBAAuB,SAAS,gBAAgB"}
package/dist/index.mjs CHANGED
@@ -138,6 +138,14 @@ function createInMemoryCacheStore(options) {
138
138
  function deriveKeyFromContentHash(exec, ctx) {
139
139
  return ctx.contentHash(exec);
140
140
  }
141
+ const pendingMiss = Symbol("cache.pendingMiss");
142
+ function pendingOf(ctx) {
143
+ const miss = ctx.state(pendingMiss)["miss"];
144
+ return isPendingMiss(miss) ? miss : void 0;
145
+ }
146
+ function isPendingMiss(value) {
147
+ return typeof value === "object" && value !== null && "entry" in value && "buffer" in value;
148
+ }
141
149
  /**
142
150
  * Creates a read-through cache middleware that works with every family runtime.
143
151
  *
@@ -145,10 +153,10 @@ function deriveKeyFromContentHash(exec, ctx) {
145
153
  * `bypass`, and the read runs in runtime scope (not inside a connection or transaction). The key
146
154
  * is the annotation's `key`, else `deriveKey(exec, ctx)`.
147
155
  *
148
- * - `interceptQuery` — on a hit, returns the stored rows and the driver does not run. On a miss,
149
- * starts collecting rows.
156
+ * - `intercept.onQuery` — on a hit, returns the stored rows and the driver does not run. On a
157
+ * miss, starts collecting rows.
150
158
  * - `onRow` — collects each row of a miss.
151
- * - `afterQuery` — when the driver completed the read, calls `store.set(entry, rows)` with the
159
+ * - `activityEnded` — when the driver completed the read, calls `store.set(entry, rows)` with the
152
160
  * entry `store.get` returned, which stores only if the key's version has not moved. If an
153
161
  * `unset` moved it meanwhile, `set` returns `false` and the middleware logs
154
162
  * `middleware.cache.store-skipped`.
@@ -169,8 +177,7 @@ function deriveKeyFromContentHash(exec, ctx) {
169
177
  function createCacheMiddleware(options) {
170
178
  const store = options?.store ?? createInMemoryCacheStore();
171
179
  const deriveKey = options?.deriveKey ?? deriveKeyFromContentHash;
172
- const pending = /* @__PURE__ */ new WeakMap();
173
- async function interceptQuery(exec, ctx) {
180
+ async function onQuery(exec, ctx) {
174
181
  if (ctx.scope !== "runtime") return;
175
182
  const annotation = cacheAnnotation.read(exec);
176
183
  if (annotation === void 0 || annotation.bypass === true) return;
@@ -187,24 +194,24 @@ function createCacheMiddleware(options) {
187
194
  });
188
195
  return { rows: entry.data.value };
189
196
  }
190
- pending.set(exec, {
197
+ ctx.state(pendingMiss)["miss"] = {
191
198
  entry,
192
199
  buffer: []
193
- });
200
+ };
194
201
  ctx.log.debug?.({
195
202
  event: "middleware.cache.miss",
196
203
  middleware: "cache",
197
204
  key
198
205
  });
199
206
  }
200
- async function onRow(row, exec, _ctx) {
201
- pending.get(exec)?.buffer.push(row);
207
+ async function onRow(row, _exec, ctx) {
208
+ pendingOf(ctx)?.buffer.push(row);
202
209
  }
203
- async function afterQuery(exec, result, ctx) {
204
- const miss = pending.get(exec);
210
+ async function activityEnded(_activity, result, ctx) {
211
+ const miss = pendingOf(ctx);
205
212
  if (miss === void 0) return;
206
- pending.delete(exec);
207
- if (!result.completed || result.source !== "driver") return;
213
+ delete ctx.state(pendingMiss)["miss"];
214
+ if (result.kind !== "statement" || result.outcome !== "succeeded" || result.source !== "driver") return;
208
215
  const stored = await store.set(miss.entry, miss.buffer);
209
216
  ctx.log.debug?.({
210
217
  event: stored ? "middleware.cache.store" : "middleware.cache.store-skipped",
@@ -222,9 +229,9 @@ function createCacheMiddleware(options) {
222
229
  }
223
230
  return {
224
231
  name: "cache",
225
- interceptQuery,
232
+ intercept: { onQuery },
226
233
  onRow,
227
- afterQuery,
234
+ activityEnded,
228
235
  invalidate
229
236
  };
230
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../3-extensions/middleware-cache/dist/index.mjs"],"sourcesContent":["import { defineAnnotation } from \"@internal/framework-components/runtime\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/cache-annotation.ts\n/**\n* Marks a read for the cache middleware. It applies to reads only: a write terminal refuses it at\n* compile time and at run time. The middleware reads it from `plan.meta.annotations.cache`.\n*\n* `TMeta` types `meta` for this call only. Nothing ties it to the store's `TMeta`, so a store\n* package should export a wrapper typed with its own meta, such as\n* `(o: CacheAnnotationOptions<TagMeta>) => cacheAnnotation<TagMeta>(o)`.\n*\n* @example\n* ```typescript\n* import { cacheAnnotation } from '@internal/middleware-cache';\n*\n* // ORM read terminal — accepts the read-only annotation via the meta callback.\n* const user = await db.orm.public.User.first(\n* { id },\n* (meta) => meta.annotate(cacheAnnotation({ key: `user-${id}` })),\n* );\n*\n* // SQL DSL select builder — chainable.\n* const plan = db.sql\n* .from(tables.user)\n* .annotate(cacheAnnotation({}))\n* .select({ id: tables.user.columns.id })\n* .build();\n* ```\n*/\nconst cacheAnnotation = withTypedMeta(defineAnnotation()({\n\tnamespace: \"cache\",\n\tapplicableTo: [\"read\"]\n}));\nfunction withTypedMeta(handle) {\n\tfunction cacheAnnotationWithMeta(options) {\n\t\treturn handle(options);\n\t}\n\treturn Object.freeze(Object.assign(cacheAnnotationWithMeta, {\n\t\tnamespace: handle.namespace,\n\t\tapplicableTo: handle.applicableTo,\n\t\tread: handle.read\n\t}));\n}\n//#endregion\n//#region src/cache-store.ts\nfunction metaUnsupported() {\n\treturn structuredError(\"RUNTIME.CACHE_STORE_META_UNSUPPORTED\", \"The in-memory cache store cannot remove entries by meta because it does not index meta\", { fix: \"Invalidate by keys, or supply a CacheStore that indexes meta in set and unset.\" });\n}\nfunction invalidOption(argument, received, expected) {\n\treturn structuredError(\"RUNTIME.ARGUMENT_INVALID\", `createInMemoryCacheStore: ${argument} must be ${expected}`, {\n\t\tfix: `Pass ${argument} as ${expected}, or leave it unset for the default.`,\n\t\tmeta: {\n\t\t\thelper: \"createInMemoryCacheStore\",\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The default cache store: a least-recently-used map with one lifetime for every value, local to\n* the process. It holds `CachedRows` unless given another `TValue`. A key's version is kept for\n* `ttlMs` after the `unset` that moved it (see `InMemoryCacheStoreOptions`). It ignores `meta` in\n* `get` and `set`, and its `unset` rejects any `meta`, including `null`, before changing anything.\n* It throws `RUNTIME.ARGUMENT_INVALID` for a `maxEntries` or `ttlMs` outside the ranges above.\n*/\nfunction createInMemoryCacheStore(options) {\n\tconst maxEntries = options?.maxEntries ?? 1e3;\n\tconst ttlMs = options?.ttlMs ?? 6e4;\n\tconst clock = options?.clock ?? Date.now;\n\tif (!Number.isInteger(maxEntries) || maxEntries <= 0) throw invalidOption(\"maxEntries\", maxEntries, \"a positive integer\");\n\tif (!(ttlMs > 0)) throw invalidOption(\"ttlMs\", ttlMs, \"a positive number of milliseconds, or Infinity\");\n\tconst records = /* @__PURE__ */ new Map();\n\tconst versions = /* @__PURE__ */ new Map();\n\tfunction forgetExpiredVersions() {\n\t\tconst now = clock();\n\t\tfor (const [key, record] of versions) {\n\t\t\tif (now < record.expiresAt) return;\n\t\t\tversions.delete(key);\n\t\t}\n\t}\n\tfunction versionOf(key) {\n\t\tforgetExpiredVersions();\n\t\treturn versions.get(key)?.version ?? 0;\n\t}\n\tfunction liveRecord(key) {\n\t\tconst record = records.get(key);\n\t\tif (record === void 0) return;\n\t\trecords.delete(key);\n\t\tif (clock() >= record.expiresAt) return;\n\t\trecords.set(key, record);\n\t\treturn record;\n\t}\n\tasync function get(target) {\n\t\tconst record = liveRecord(target.key);\n\t\treturn {\n\t\t\tkey: target.key,\n\t\t\tmeta: target.meta,\n\t\t\tversion: versionOf(target.key),\n\t\t\tdata: record === void 0 ? { empty: true } : {\n\t\t\t\tempty: false,\n\t\t\t\tvalue: record.value\n\t\t\t}\n\t\t};\n\t}\n\tasync function set(entry, value) {\n\t\tif (entry.version !== versionOf(entry.key)) return false;\n\t\trecords.delete(entry.key);\n\t\trecords.set(entry.key, {\n\t\t\tvalue,\n\t\t\texpiresAt: clock() + ttlMs\n\t\t});\n\t\tfor (const leastRecentlyUsed of records.keys()) {\n\t\t\tif (records.size <= maxEntries) break;\n\t\t\trecords.delete(leastRecentlyUsed);\n\t\t}\n\t\treturn true;\n\t}\n\tasync function unset(target) {\n\t\tif (target.meta !== void 0) throw metaUnsupported();\n\t\tfor (const key of target.keys ?? []) {\n\t\t\trecords.delete(key);\n\t\t\tconst version = versionOf(key) + 1;\n\t\t\tversions.delete(key);\n\t\t\tversions.set(key, {\n\t\t\t\tversion,\n\t\t\t\texpiresAt: clock() + ttlMs\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tget,\n\t\tset,\n\t\tunset\n\t};\n}\n//#endregion\n//#region src/cache-middleware.ts\n/**\n* The default `deriveKey`: the family runtime's content hash of the plan, which covers the\n* statement, its parameters and the storage hash.\n*/\nfunction deriveKeyFromContentHash(exec, ctx) {\n\treturn ctx.contentHash(exec);\n}\n/**\n* Creates a read-through cache middleware that works with every family runtime.\n*\n* It caches a read when the plan carries `cacheAnnotation`, the annotation does not set\n* `bypass`, and the read runs in runtime scope (not inside a connection or transaction). The key\n* is the annotation's `key`, else `deriveKey(exec, ctx)`.\n*\n* - `interceptQuery` — on a hit, returns the stored rows and the driver does not run. On a miss,\n* starts collecting rows.\n* - `onRow` — collects each row of a miss.\n* - `afterQuery` — when the driver completed the read, calls `store.set(entry, rows)` with the\n* entry `store.get` returned, which stores only if the key's version has not moved. If an\n* `unset` moved it meanwhile, `set` returns `false` and the middleware logs\n* `middleware.cache.store-skipped`.\n*\n* @example\n* ```typescript\n* const cache = createCacheMiddleware();\n* const db = postgres<Contract>({ contractJson, url, middleware: [cache] });\n*\n* const user = await db.orm.public.User.first(\n* { id: 1 },\n* (meta) => meta.annotate(cacheAnnotation({ key: 'user-1' })),\n* );\n* await db.orm.public.User.where({ id: 1 }).update({ name: 'Alicia' });\n* await cache.invalidate({ keys: ['user-1'] });\n* ```\n*/\nfunction createCacheMiddleware(options) {\n\tconst store = options?.store ?? createInMemoryCacheStore();\n\tconst deriveKey = options?.deriveKey ?? deriveKeyFromContentHash;\n\tconst pending = /* @__PURE__ */ new WeakMap();\n\tasync function interceptQuery(exec, ctx) {\n\t\tif (ctx.scope !== \"runtime\") return;\n\t\tconst annotation = cacheAnnotation.read(exec);\n\t\tif (annotation === void 0 || annotation.bypass === true) return;\n\t\tconst key = annotation.key ?? await deriveKey(exec, ctx);\n\t\tconst entry = await store.get({\n\t\t\tkey,\n\t\t\tmeta: annotation.meta\n\t\t});\n\t\tif (!entry.data.empty) {\n\t\t\tctx.log.debug?.({\n\t\t\t\tevent: \"middleware.cache.hit\",\n\t\t\t\tmiddleware: \"cache\",\n\t\t\t\tkey\n\t\t\t});\n\t\t\treturn { rows: entry.data.value };\n\t\t}\n\t\tpending.set(exec, {\n\t\t\tentry,\n\t\t\tbuffer: []\n\t\t});\n\t\tctx.log.debug?.({\n\t\t\tevent: \"middleware.cache.miss\",\n\t\t\tmiddleware: \"cache\",\n\t\t\tkey\n\t\t});\n\t}\n\tasync function onRow(row, exec, _ctx) {\n\t\tpending.get(exec)?.buffer.push(row);\n\t}\n\tasync function afterQuery(exec, result, ctx) {\n\t\tconst miss = pending.get(exec);\n\t\tif (miss === void 0) return;\n\t\tpending.delete(exec);\n\t\tif (!result.completed || result.source !== \"driver\") return;\n\t\tconst stored = await store.set(miss.entry, miss.buffer);\n\t\tctx.log.debug?.({\n\t\t\tevent: stored ? \"middleware.cache.store\" : \"middleware.cache.store-skipped\",\n\t\t\tmiddleware: \"cache\",\n\t\t\tkey: miss.entry.key\n\t\t});\n\t}\n\tasync function invalidate(target) {\n\t\tconst keys = target.keys !== void 0 && target.keys.length > 0 ? target.keys : void 0;\n\t\tif (keys === void 0 && target.meta === void 0) return;\n\t\tawait store.unset({\n\t\t\tkeys,\n\t\t\tmeta: target.meta\n\t\t});\n\t}\n\treturn {\n\t\tname: \"cache\",\n\t\tinterceptQuery,\n\t\tonRow,\n\t\tafterQuery,\n\t\tinvalidate\n\t};\n}\n//#endregion\nexport { cacheAnnotation, createCacheMiddleware, createInMemoryCacheStore, deriveKeyFromContentHash };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,kBAAkB,cAAc,iBAAiB,CAAC,CAAC;CACxD,WAAW;CACX,cAAc,CAAC,MAAM;AACtB,CAAC,CAAC;AACF,SAAS,cAAc,QAAQ;CAC9B,SAAS,wBAAwB,SAAS;EACzC,OAAO,OAAO,OAAO;CACtB;CACA,OAAO,OAAO,OAAO,OAAO,OAAO,yBAAyB;EAC3D,WAAW,OAAO;EAClB,cAAc,OAAO;EACrB,MAAM,OAAO;CACd,CAAC,CAAC;AACH;AAGA,SAAS,kBAAkB;CAC1B,OAAO,gBAAgB,wCAAwC,0FAA0F,EAAE,KAAK,iFAAiF,CAAC;AACnP;AACA,SAAS,cAAc,UAAU,UAAU,UAAU;CACpD,OAAO,gBAAgB,4BAA4B,6BAA6B,SAAS,WAAW,YAAY;EAC/G,KAAK,QAAQ,SAAS,MAAM,SAAS;EACrC,MAAM;GACL,QAAQ;GACR;GACA;EACD;CACD,CAAC;AACF;;;;;;;;AAQA,SAAS,yBAAyB,SAAS;CAC1C,MAAM,aAAa,SAAS,cAAc;CAC1C,MAAM,QAAQ,SAAS,SAAS;CAChC,MAAM,QAAQ,SAAS,SAAS,KAAK;CACrC,IAAI,CAAC,OAAO,UAAU,UAAU,KAAK,cAAc,GAAG,MAAM,cAAc,cAAc,YAAY,oBAAoB;CACxH,IAAI,EAAE,QAAQ,IAAI,MAAM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AAW,UAAU;EACrD,MAAM,SAAS,MAAM,MAAM,IAAI,KAAK,OAAO,KAAK,MAAM;EACtD,IAAI,IAAI,QAAQ;GACf,OAAO,SAAS,2BAA2B;GAC3C,YAAY;GACZ,KAAK,KAAK,MAAM;EACjB,CAAC;CACF;CACA,eAAe,WAAW,QAAQ;EACjC,MAAM,OAAO,OAAO,SAAS,KAAK,KAAK,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK;EACnF,IAAI,SAAS,KAAK,KAAK,OAAO,SAAS,KAAK,GAAG;EAC/C,MAAM,MAAM,MAAM;GACjB;GACA,MAAM,OAAO;EACd,CAAC;CACF;CACA,OAAO;EACN,MAAM;EACN;EACA;EACA;EACA;CACD;AACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../3-extensions/middleware-cache/dist/index.mjs"],"sourcesContent":["import { defineAnnotation } from \"@internal/framework-components/runtime\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/cache-annotation.ts\n/**\n* Marks a read for the cache middleware. It applies to reads only: a write terminal refuses it at\n* compile time and at run time. The middleware reads it from `plan.meta.annotations.cache`.\n*\n* `TMeta` types `meta` for this call only. Nothing ties it to the store's `TMeta`, so a store\n* package should export a wrapper typed with its own meta, such as\n* `(o: CacheAnnotationOptions<TagMeta>) => cacheAnnotation<TagMeta>(o)`.\n*\n* @example\n* ```typescript\n* import { cacheAnnotation } from '@internal/middleware-cache';\n*\n* // ORM read terminal — accepts the read-only annotation via the meta callback.\n* const user = await db.orm.public.User.first(\n* { id },\n* (meta) => meta.annotate(cacheAnnotation({ key: `user-${id}` })),\n* );\n*\n* // SQL DSL select builder — chainable.\n* const plan = db.sql\n* .from(tables.user)\n* .annotate(cacheAnnotation({}))\n* .select({ id: tables.user.columns.id })\n* .build();\n* ```\n*/\nconst cacheAnnotation = withTypedMeta(defineAnnotation()({\n\tnamespace: \"cache\",\n\tapplicableTo: [\"read\"]\n}));\nfunction withTypedMeta(handle) {\n\tfunction cacheAnnotationWithMeta(options) {\n\t\treturn handle(options);\n\t}\n\treturn Object.freeze(Object.assign(cacheAnnotationWithMeta, {\n\t\tnamespace: handle.namespace,\n\t\tapplicableTo: handle.applicableTo,\n\t\tread: handle.read\n\t}));\n}\n//#endregion\n//#region src/cache-store.ts\nfunction metaUnsupported() {\n\treturn structuredError(\"RUNTIME.CACHE_STORE_META_UNSUPPORTED\", \"The in-memory cache store cannot remove entries by meta because it does not index meta\", { fix: \"Invalidate by keys, or supply a CacheStore that indexes meta in set and unset.\" });\n}\nfunction invalidOption(argument, received, expected) {\n\treturn structuredError(\"RUNTIME.ARGUMENT_INVALID\", `createInMemoryCacheStore: ${argument} must be ${expected}`, {\n\t\tfix: `Pass ${argument} as ${expected}, or leave it unset for the default.`,\n\t\tmeta: {\n\t\t\thelper: \"createInMemoryCacheStore\",\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\n/**\n* The default cache store: a least-recently-used map with one lifetime for every value, local to\n* the process. It holds `CachedRows` unless given another `TValue`. A key's version is kept for\n* `ttlMs` after the `unset` that moved it (see `InMemoryCacheStoreOptions`). It ignores `meta` in\n* `get` and `set`, and its `unset` rejects any `meta`, including `null`, before changing anything.\n* It throws `RUNTIME.ARGUMENT_INVALID` for a `maxEntries` or `ttlMs` outside the ranges above.\n*/\nfunction createInMemoryCacheStore(options) {\n\tconst maxEntries = options?.maxEntries ?? 1e3;\n\tconst ttlMs = options?.ttlMs ?? 6e4;\n\tconst clock = options?.clock ?? Date.now;\n\tif (!Number.isInteger(maxEntries) || maxEntries <= 0) throw invalidOption(\"maxEntries\", maxEntries, \"a positive integer\");\n\tif (!(ttlMs > 0)) throw invalidOption(\"ttlMs\", ttlMs, \"a positive number of milliseconds, or Infinity\");\n\tconst records = /* @__PURE__ */ new Map();\n\tconst versions = /* @__PURE__ */ new Map();\n\tfunction forgetExpiredVersions() {\n\t\tconst now = clock();\n\t\tfor (const [key, record] of versions) {\n\t\t\tif (now < record.expiresAt) return;\n\t\t\tversions.delete(key);\n\t\t}\n\t}\n\tfunction versionOf(key) {\n\t\tforgetExpiredVersions();\n\t\treturn versions.get(key)?.version ?? 0;\n\t}\n\tfunction liveRecord(key) {\n\t\tconst record = records.get(key);\n\t\tif (record === void 0) return;\n\t\trecords.delete(key);\n\t\tif (clock() >= record.expiresAt) return;\n\t\trecords.set(key, record);\n\t\treturn record;\n\t}\n\tasync function get(target) {\n\t\tconst record = liveRecord(target.key);\n\t\treturn {\n\t\t\tkey: target.key,\n\t\t\tmeta: target.meta,\n\t\t\tversion: versionOf(target.key),\n\t\t\tdata: record === void 0 ? { empty: true } : {\n\t\t\t\tempty: false,\n\t\t\t\tvalue: record.value\n\t\t\t}\n\t\t};\n\t}\n\tasync function set(entry, value) {\n\t\tif (entry.version !== versionOf(entry.key)) return false;\n\t\trecords.delete(entry.key);\n\t\trecords.set(entry.key, {\n\t\t\tvalue,\n\t\t\texpiresAt: clock() + ttlMs\n\t\t});\n\t\tfor (const leastRecentlyUsed of records.keys()) {\n\t\t\tif (records.size <= maxEntries) break;\n\t\t\trecords.delete(leastRecentlyUsed);\n\t\t}\n\t\treturn true;\n\t}\n\tasync function unset(target) {\n\t\tif (target.meta !== void 0) throw metaUnsupported();\n\t\tfor (const key of target.keys ?? []) {\n\t\t\trecords.delete(key);\n\t\t\tconst version = versionOf(key) + 1;\n\t\t\tversions.delete(key);\n\t\t\tversions.set(key, {\n\t\t\t\tversion,\n\t\t\t\texpiresAt: clock() + ttlMs\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tget,\n\t\tset,\n\t\tunset\n\t};\n}\n//#endregion\n//#region src/cache-middleware.ts\n/**\n* The default `deriveKey`: the family runtime's content hash of the plan, which covers the\n* statement, its parameters and the storage hash.\n*/\nfunction deriveKeyFromContentHash(exec, ctx) {\n\treturn ctx.contentHash(exec);\n}\nconst pendingMiss = Symbol(\"cache.pendingMiss\");\nfunction pendingOf(ctx) {\n\tconst miss = ctx.state(pendingMiss)[\"miss\"];\n\treturn isPendingMiss(miss) ? miss : void 0;\n}\nfunction isPendingMiss(value) {\n\treturn typeof value === \"object\" && value !== null && \"entry\" in value && \"buffer\" in value;\n}\n/**\n* Creates a read-through cache middleware that works with every family runtime.\n*\n* It caches a read when the plan carries `cacheAnnotation`, the annotation does not set\n* `bypass`, and the read runs in runtime scope (not inside a connection or transaction). The key\n* is the annotation's `key`, else `deriveKey(exec, ctx)`.\n*\n* - `intercept.onQuery` — on a hit, returns the stored rows and the driver does not run. On a\n* miss, starts collecting rows.\n* - `onRow` — collects each row of a miss.\n* - `activityEnded` — when the driver completed the read, calls `store.set(entry, rows)` with the\n* entry `store.get` returned, which stores only if the key's version has not moved. If an\n* `unset` moved it meanwhile, `set` returns `false` and the middleware logs\n* `middleware.cache.store-skipped`.\n*\n* @example\n* ```typescript\n* const cache = createCacheMiddleware();\n* const db = postgres<Contract>({ contractJson, url, middleware: [cache] });\n*\n* const user = await db.orm.public.User.first(\n* { id: 1 },\n* (meta) => meta.annotate(cacheAnnotation({ key: 'user-1' })),\n* );\n* await db.orm.public.User.where({ id: 1 }).update({ name: 'Alicia' });\n* await cache.invalidate({ keys: ['user-1'] });\n* ```\n*/\nfunction createCacheMiddleware(options) {\n\tconst store = options?.store ?? createInMemoryCacheStore();\n\tconst deriveKey = options?.deriveKey ?? deriveKeyFromContentHash;\n\tasync function onQuery(exec, ctx) {\n\t\tif (ctx.scope !== \"runtime\") return;\n\t\tconst annotation = cacheAnnotation.read(exec);\n\t\tif (annotation === void 0 || annotation.bypass === true) return;\n\t\tconst key = annotation.key ?? await deriveKey(exec, ctx);\n\t\tconst entry = await store.get({\n\t\t\tkey,\n\t\t\tmeta: annotation.meta\n\t\t});\n\t\tif (!entry.data.empty) {\n\t\t\tctx.log.debug?.({\n\t\t\t\tevent: \"middleware.cache.hit\",\n\t\t\t\tmiddleware: \"cache\",\n\t\t\t\tkey\n\t\t\t});\n\t\t\treturn { rows: entry.data.value };\n\t\t}\n\t\tctx.state(pendingMiss)[\"miss\"] = {\n\t\t\tentry,\n\t\t\tbuffer: []\n\t\t};\n\t\tctx.log.debug?.({\n\t\t\tevent: \"middleware.cache.miss\",\n\t\t\tmiddleware: \"cache\",\n\t\t\tkey\n\t\t});\n\t}\n\tasync function onRow(row, _exec, ctx) {\n\t\tpendingOf(ctx)?.buffer.push(row);\n\t}\n\tasync function activityEnded(_activity, result, ctx) {\n\t\tconst miss = pendingOf(ctx);\n\t\tif (miss === void 0) return;\n\t\tdelete ctx.state(pendingMiss)[\"miss\"];\n\t\tif (result.kind !== \"statement\" || result.outcome !== \"succeeded\" || result.source !== \"driver\") return;\n\t\tconst stored = await store.set(miss.entry, miss.buffer);\n\t\tctx.log.debug?.({\n\t\t\tevent: stored ? \"middleware.cache.store\" : \"middleware.cache.store-skipped\",\n\t\t\tmiddleware: \"cache\",\n\t\t\tkey: miss.entry.key\n\t\t});\n\t}\n\tasync function invalidate(target) {\n\t\tconst keys = target.keys !== void 0 && target.keys.length > 0 ? target.keys : void 0;\n\t\tif (keys === void 0 && target.meta === void 0) return;\n\t\tawait store.unset({\n\t\t\tkeys,\n\t\t\tmeta: target.meta\n\t\t});\n\t}\n\treturn {\n\t\tname: \"cache\",\n\t\tintercept: { onQuery },\n\t\tonRow,\n\t\tactivityEnded,\n\t\tinvalidate\n\t};\n}\n//#endregion\nexport { cacheAnnotation, createCacheMiddleware, createInMemoryCacheStore, deriveKeyFromContentHash };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,kBAAkB,cAAc,iBAAiB,CAAC,CAAC;CACxD,WAAW;CACX,cAAc,CAAC,MAAM;AACtB,CAAC,CAAC;AACF,SAAS,cAAc,QAAQ;CAC9B,SAAS,wBAAwB,SAAS;EACzC,OAAO,OAAO,OAAO;CACtB;CACA,OAAO,OAAO,OAAO,OAAO,OAAO,yBAAyB;EAC3D,WAAW,OAAO;EAClB,cAAc,OAAO;EACrB,MAAM,OAAO;CACd,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,QAAQ;EACrB;EACA;EACA;CACD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-extension-middleware-cache",
3
- "version": "8.0.0-rc.17-dev.26",
3
+ "version": "8.0.0-rc.17-dev.27",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,12 +9,12 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-framework": "8.0.0-rc.17-dev.26"
12
+ "@prisma/orm-framework": "8.0.0-rc.17-dev.27"
13
13
  },
14
14
  "devDependencies": {
15
- "@internal/middleware-cache": "8.0.0-rc.17-dev.26",
16
- "@repo/tsconfig": "8.0.0-rc.17-dev.26",
17
- "@repo/tsdown": "8.0.0-rc.17-dev.26",
15
+ "@internal/middleware-cache": "8.0.0-rc.17-dev.27",
16
+ "@repo/tsconfig": "8.0.0-rc.17-dev.27",
17
+ "@repo/tsdown": "8.0.0-rc.17-dev.27",
18
18
  "tsdown": "0.22.14",
19
19
  "typescript": "5.9.3"
20
20
  },