Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@keyv/sqlite

jaredwray25.2kMIT4.0.1TypeScript support: included

SQLite storage adapter for Keyv

sqlite, sql, keyv, storage, adapter, key, value, store, cache, ttl

readme

@keyv/sqlite keyv

SQLite storage adapter for Keyv

build codecov npm npm

SQLite storage adapter for Keyv.

Install

npm install --save keyv @keyv/sqlite

Usage

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:

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 }); 

License

MIT © Jared Wray