SQLite storage adapter for Keyv
npm install @keyv/sqlite> SQLite storage adapter for Keyv




SQLite storage adapter for Keyv.
``shell`
npm install --save keyv @keyv/sqlite
`js
import Keyv from 'keyv';
import KeyvSqlite from '@keyv/sqlite';
const keyv = new Keyv(new KeyvSqlite('sqlite://path/to/database.sqlite'));
keyv.on('error', handleConnectionError);
`
You can specify the table and busyTimeout option.
e.g:
`js
import Keyv from 'keyv';
import KeyvSqlite from '@keyv/sqlite';
const keyvSqlite = new KeyvSqlite('sqlite://path/to/database.sqlite', {
table: 'cache',
busyTimeout: 10000
});
const keyv = new Keyv({ store: keyvSqlite });
`
You can also use a helper function to create Keyv with KeyvSqlite store.
`js
import {createKeyv} from '@keyv/sqlite';
const keyv = createKeyv('sqlite://path/to/database.sqlite');
``