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 |
|
9 | SQLite storage adapter for [Keyv](https://github.com/lukechilds/keyv).
|
10 |
|
11 | ## Install
|
12 |
|
13 | ```shell
|
14 | npm install --save keyv @keyv/sqlite
|
15 | ```
|
16 |
|
17 | ## Usage
|
18 |
|
19 | ```js
|
20 | const Keyv = require('keyv');
|
21 |
|
22 | const keyv = new Keyv('sqlite://path/to/database.sqlite');
|
23 | keyv.on('error', handleConnectionError);
|
24 | ```
|
25 |
|
26 | You can specify the `table` and [`busyTimeout`](https://sqlite.org/c3ref/busy_timeout.html) option.
|
27 |
|
28 | e.g:
|
29 |
|
30 | ```js
|
31 | const keyv = new Keyv('sqlite://path/to/database.sqlite', {
|
32 | table: 'cache',
|
33 | busyTimeout: 10000
|
34 | });
|
35 | ```
|
36 |
|
37 | ## License
|
38 |
|
39 | MIT © Jared Wray & Luke Childs
|