MCPcopy
hub / github.com/nodejs/undici / SqliteCacheStore

Class SqliteCacheStore

lib/cache/sqlite-cache-store.js:31–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 * }} SqliteStoreValue
30 */
31module.exports = class SqliteCacheStore {
32 #maxEntrySize = MAX_ENTRY_SIZE
33 #maxCount = Infinity
34
35 /**
36 * @type {import('node:sqlite').DatabaseSync}
37 */
38 #db
39
40 /**
41 * @type {import('node:sqlite').StatementSync}
42 */
43 #getValuesQuery
44
45 /**
46 * @type {import('node:sqlite').StatementSync}
47 */
48 #updateValueQuery
49
50 /**
51 * @type {import('node:sqlite').StatementSync}
52 */
53 #insertValueQuery
54
55 /**
56 * @type {import('node:sqlite').StatementSync}
57 */
58 #deleteExpiredValuesQuery
59
60 /**
61 * @type {import('node:sqlite').StatementSync}
62 */
63 #deleteByUrlQuery
64
65 /**
66 * @type {import('node:sqlite').StatementSync}
67 */
68 #countEntriesQuery
69
70 /**
71 * @type {import('node:sqlite').StatementSync | null}
72 */
73 #deleteOldValuesQuery
74
75 /**
76 * @param {import('../../types/cache-interceptor.d.ts').default.SqliteCacheStoreOpts | undefined} opts
77 */
78 constructor (opts) {
79 if (opts) {
80 if (typeof opts !== 'object') {
81 throw new TypeError('SqliteCacheStore options must be an object')
82 }
83
84 if (opts.maxEntrySize !== undefined) {
85 if (
86 typeof opts.maxEntrySize !== 'number' ||
87 !Number.isInteger(opts.maxEntrySize) ||
88 opts.maxEntrySize < 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…