This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A simple key-value store w/persistent sqlite3 database. | |
class KV { | |
KV._(this._db); | |
final Database _db; | |
static Future<KV> open(String name) async { | |
return KV._(sqlite3.open(name)..execute('create table if not exists kv (k text primary key, v jsonb)')); | |
} | |
Future<Object?> get(String key) async { |