Skip to content

Instantly share code, notes, and snippets.

View naveen1337's full-sized avatar

Naveen 1337 naveen1337

View GitHub Profile
@naveen1337
naveen1337 / demo.ts
Created December 23, 2024 15:14 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);