prorm in the browser

Version 2.2.0 — one script tag, no build step.

<script src="https://prod-orm.io/cdn/prorm.min.js"></script>
const db = await prorm.openBrowserDatabase({ database: 'notes' });

const Note = db.define('Note', { title: prorm.DataTypes.STRING });
await db.sync();
await Note.create({ title: 'Hello' });
await Note.findAll({ where: { title: { like: 'H%' } } });

A real SQLite database in the page: SQLite compiled to WebAssembly where Web SQL is gone, which is Chrome and Firefox. localStorage, sessionStorage, cookies and adapters for PouchDB and RxDB come with it.

Files

FileFormatSize
prorm-2.2.0.jsscript tag (IIFE)1403.8 KiB
prorm-2.2.0.min.jsscript tag (IIFE)548.3 KiB
prorm-2.2.0.esm.jsES module1316.8 KiB
prorm-2.2.0.esm.min.jsES module547.8 KiB

Unversioned aliases follow the latest release: prorm.js, prorm.min.js, prorm.esm.js, prorm.esm.min.js. Pin a version for production; manifest.json lists what is published.

The SQLite engine

Served from /cdn/sqlite/ and fetched the first time you open a database — a page that never opens one downloads none of it.