Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback

WebSQL for Deno

A ponyfill of WebSQL which provides a complete async interface for Deno.

Usage

Import the ponyfill and use just like the spec.

import { configureSQLiteDB, openDatabase } from "websql/mod.ts";

// Optional; required for persistence, defaults to memory: true
configureSQLiteDB({ memory: false });

const db = openDatabase("myawesome.db", "1.0", "MyAwesomeDB", 0);

Dispatching an event of type destroy_sqlite will close all open file handles and clear all cached database instances.

dispatchEvent(new Event("destroy_sqlite"));

Documentation

Please see the spec for complete documentation; keep in mind that sync operations are not supported.

What is it?

A complete rewrite of Philzen/WebSQL-Polyfill, using dyedgreen/deno-sqlite as the sql engine.

The ponyfill creates WebSQL isntances in-memory by default; call configureSQLiteDB with the memory: false option to persist to disk.