superapp
BackendDatabases

sql.js

In-browser SQLite via WASM.

Chat in Claude

Run SQLite in the browser using sql.js, a WASM build of SQLite.

import { createEngine } from '@superapp/backend'
import { sqlJsProvider } from '@superapp/backend/databases/sql-js'

const engine = createEngine({
  providers: [sqlJsProvider],
  connections: {
    main: { type: 'sql-js' },
  },
})

Install

npm install sql.js

Use Cases

  • Browser apps -- Client-side SQL without a server
  • Offline-first -- Store data locally in the browser
  • Demos -- Interactive SQL sandboxes

Connection Options

OptionTypeDescription
dataArrayLike<number>Initial database binary (optional)
locateFile(filename: string) => stringCustom path to WASM file

On this page