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 Oct 1, 2024
1 parent 7ea49d3 commit 6c8ea8f
Show file tree
Hide file tree
Showing 5 changed files with 617 additions and 0 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 6c8ea8f

Please sign in to comment.