SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
////////////////////////////////////////
// 1. Types
////////////////////////////////////////
export type SchemaDefinition = Record<string, any>;
export interface CreateDBOptions {
idColumn?: string;
jsonColumn?: string;
debugSql?: boolean;
}
////////////////////////////////////////
// 2. The shape of what we return
////////////////////////////////////////
export interface DBClient<TSchema extends SchemaDefinition> {
/** Reader: returns plain JS objects, no...
Read more at gist.github.com