A demonstration of sqlite working on both React Native (expo-sqlite) and Web (absurd-sql).
Rough source code to get sqlite working on both React Native and Web with a single interface.
Uses expo-sqlite
.
Uses absurd-sql
with sql.js (WASM) and IndexedDB backend purely for byte storage.
Uses a forked knex.js that strips everything out except for sqlite3 query building.
import db from './db';
const query = db.knex('user').where({id: 'foo'}).toString();
db.get(query);