Skip to content

Commit 60a9679

Browse files
committed
feat: sqlite cache store
Co-authored-by: Robert Nagy <[email protected]> Co-authored-by: Isak Törnros <[email protected]> Signed-off-by: flakey5 <[email protected]>
1 parent 28b10fa commit 60a9679

File tree

4 files changed

+627
-3
lines changed

4 files changed

+627
-3
lines changed

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
const { env, execArgv } = require('node:process')
34
const Client = require('./lib/dispatcher/client')
45
const Dispatcher = require('./lib/dispatcher/dispatcher')
56
const Pool = require('./lib/dispatcher/pool')
@@ -48,6 +49,13 @@ module.exports.cacheStores = {
4849
MemoryCacheStore: require('./lib/cache/memory-cache-store')
4950
}
5051

52+
if (
53+
(env.NODE_OPTIONS && env.NODE_OPTIONS.match(/experimental(-|_)sqlite/)) ||
54+
execArgv.some(argv => argv.match(/experimental(-|_)sqlite/))
55+
) {
56+
module.exports.cacheStores.SqliteCacheStore = require('./lib/cache/sqlite-cache-store')
57+
}
58+
5159
module.exports.buildConnector = buildConnector
5260
module.exports.errors = errors
5361
module.exports.util = {

0 commit comments

Comments
 (0)