File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,8 @@ module.exports.cacheStores = {
49
49
MemoryCacheStore : require ( './lib/cache/memory-cache-store' )
50
50
}
51
51
52
- try {
53
- const SqliteCacheStore = require ( './lib/cache/sqlite-cache-store' )
54
- module . exports . cacheStores . SqliteCacheStore = SqliteCacheStore
55
- } catch ( err ) {
56
- // Most likely node:sqlite was not present, since SqliteCacheStore is
57
- // optional, don't throw. Don't check specific error codes here because while
58
- // ERR_UNKNOWN_BUILTIN_MODULE is expected, users have seen other codes like
59
- // MODULE_NOT_FOUND
60
- }
52
+ const SqliteCacheStore = require ( './lib/cache/sqlite-cache-store' )
53
+ module . exports . cacheStores . SqliteCacheStore = SqliteCacheStore
61
54
62
55
module . exports . buildConnector = buildConnector
63
56
module . exports . errors = errors
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const { DatabaseSync } = require ( 'node:sqlite' )
4
3
const { Writable } = require ( 'stream' )
5
4
const { assertCacheKey, assertCacheValue } = require ( '../util/cache.js' )
6
5
6
+ let DatabaseSync
7
+
7
8
const VERSION = 3
8
9
9
10
// 2gb
@@ -101,6 +102,9 @@ module.exports = class SqliteCacheStore {
101
102
}
102
103
}
103
104
105
+ if ( ! DatabaseSync ) {
106
+ DatabaseSync = require ( 'node:sqlite' ) . DatabaseSync
107
+ }
104
108
this . #db = new DatabaseSync ( opts ?. location ?? ':memory:' )
105
109
106
110
this . #db. exec ( `
You can’t perform that action at this time.
0 commit comments