Skip to content

Commit

Permalink
sqlite - adding in createKeyv and making Keyv dependency a star (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray authored Oct 20, 2024
1 parent 13d9a55 commit 0c2aa71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
},
"homepage": "https://github.com/jaredwray/keyv",
"dependencies": {
"sqlite3": "^5.1.7"
"sqlite3": "^5.1.7",
"keyv": "*"
},
"devDependencies": {
"@keyv/test-suite": "*",
"keyv": "^5.0.1",
"rimraf": "^6.0.1",
"tsd": "^0.31.2",
"xo": "^0.59.3"
Expand Down
4 changes: 3 additions & 1 deletion packages/sqlite/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EventEmitter from 'events';
import {promisify} from 'util';
import Keyv, {type KeyvStoreAdapter, type StoredData} from 'keyv';
import sqlite3 from 'sqlite3';
import {type KeyvStoreAdapter, type StoredData} from 'keyv';
import {
type Db, type DbClose, type DbQuery, type KeyvSqliteOptions,
} from './types';
Expand Down Expand Up @@ -166,5 +166,7 @@ export class KeyvSqlite extends EventEmitter implements KeyvStoreAdapter {
}
}

const createKeyv = (keyvOptions?: KeyvSqliteOptions | string) => new Keyv({store: new KeyvSqlite(keyvOptions)});

export default KeyvSqlite;
export type {KeyvSqliteOptions} from './types';

0 comments on commit 0c2aa71

Please sign in to comment.