Skip to content

Commit

Permalink
feat: sqlite cache store
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Nagy <[email protected]>
Co-authored-by: Isak Törnros <[email protected]>

Signed-off-by: flakey5 <[email protected]>
  • Loading branch information
flakey5 committed Nov 14, 2024
1 parent 28b10fa commit 8e0fa89
Show file tree
Hide file tree
Showing 4 changed files with 627 additions and 4 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

const { env, execArgv } = require('node:process')
const Client = require('./lib/dispatcher/client')
const Dispatcher = require('./lib/dispatcher/dispatcher')
const Pool = require('./lib/dispatcher/pool')
Expand Down Expand Up @@ -48,6 +49,13 @@ module.exports.cacheStores = {
MemoryCacheStore: require('./lib/cache/memory-cache-store')
}

if (
(env.NODE_OPTIONS && env.NODE_OPTIONS.match(/experimental(-|_)sqlite/)) ||
execArgv.some(argv => argv.match(/experimental(-|_)sqlite/))
) {
module.exports.cacheStores.SqliteCacheStore = require('./lib/cache/sqlite-cache-store')
}

module.exports.buildConnector = buildConnector
module.exports.errors = errors
module.exports.util = {
Expand Down
Loading

0 comments on commit 8e0fa89

Please sign in to comment.