UNPKG

1.13 kBMarkdownView Raw
1# @keyv/sqlite [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)
2
3> SQLite storage adapter for Keyv
4
5[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
6[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/master/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
7[![npm](https://img.shields.io/npm/v/@keyv/sqlite.svg)](https://www.npmjs.com/package/@keyv/sqlite)
8
9SQLite storage adapter for [Keyv](https://github.com/lukechilds/keyv).
10
11## Install
12
13```shell
14npm install --save keyv @keyv/sqlite
15```
16
17## Usage
18
19```js
20const Keyv = require('keyv');
21
22const keyv = new Keyv('sqlite://path/to/database.sqlite');
23keyv.on('error', handleConnectionError);
24```
25
26You can specify the `table` and [`busyTimeout`](https://sqlite.org/c3ref/busy_timeout.html) option.
27
28e.g:
29
30```js
31const keyv = new Keyv('sqlite://path/to/database.sqlite', {
32 table: 'cache',
33 busyTimeout: 10000
34});
35```
36
37## License
38
39MIT © Jared Wray & Luke Childs