EVERYTHING XIAOMI
Get listed

sql.js

sql.js is a free, MIT-licensed JavaScript library for creating and querying relational SQLite databases in web browsers and Node.js.

Place
#19 of 30
Score
6.1
sql.js's website

What sql.js is

sql.js is a free, MIT-licensed JavaScript library for creating and querying relational SQLite databases in web browsers and Node.js. It compiles SQLite to WebAssembly and includes an asm.js build for older-browser compatibility. Applications can run SQL, prepare statements, bind parameters, and read query results. Existing SQLite files can be imported, while databases can be exported as JavaScript typed arrays. The database is held in memory through a virtual file, so changes are not persisted automatically. Applications can register JavaScript functions and custom aggregate functions for SQL, and contributed math and string extensions are included. A Web Worker build moves CPU-intensive queries away from the main application thread, although that build has a more limited API. Examples cover npm, webpack, React, and CDNs. Release downloads include WebAssembly, asm.js, debug, and Web Worker builds, with API documentation provided.

Good

  • Free MIT-licensed library
  • WebAssembly and asm.js builds
  • Imports and exports SQLite data
  • Prepared statements and custom functions
  • Web Worker build available

Watch out

  • Changes are not persisted automatically
  • Large databases may cause out-of-memory errors
  • BigInt binding support is not available
  • Web Worker API is more limited

Who it suits

It suits developers building browser or Node.js applications that need SQLite queries in JavaScript. It is also useful for projects importing or exporting SQLite files and using custom SQL functions.

Verdict

sql.js provides SQLite functionality in JavaScript with browser, Node.js, Web Worker, and compatibility builds. Its in-memory design is useful for temporary or explicitly managed data, but larger databases and persistence require careful handling.

Plans and prices

From sql.js's own pricing page, checked 7 Oct 2026.

All about pricing
PlanPriceWhat it gives you
sql.jsFreeMIT-licensed JavaScript library; database is held in memory; Web Worker API has a more limited interface

The facts

Each one read from sql.js's own pages, with the date it was checked.

What it does

BigInt limit
BigInt support is partial: retrieving BigInt values is supported, but binding BigInt values is not.checked 7 Oct 2026
Custom functions
Applications can register JavaScript functions and custom aggregate functions for use in SQL.checked 7 Oct 2026
Distribution
The project is hosted on npm and publishes release artifacts, including WebAssembly loader and binary files.checked 7 Oct 2026
Documentation
The project provides API documentation for its module, database, statement, and statement iterator.checked 7 Oct 2026
Download
Release artifacts include WebAssembly, asm.js, debug, and Web Worker builds.checked 7 Oct 2026
Extensions
The library includes contributed math and string extension functions.checked 7 Oct 2026
Implementation
It compiles SQLite to WebAssembly and also includes an asm.js build for compatibility with older browsers.checked 7 Oct 2026
Import and export
It can import existing SQLite files and export a database as a JavaScript typed array.checked 7 Oct 2026
In-memory database
The database uses a virtual file stored in memory, so changes do not persist automatically.checked 7 Oct 2026
In-memory storage
The database is held in memory, so changes are not persisted automatically.checked 7 Oct 2026
Integrations
The README shows use with Node.js, npm, webpack, React, and CDNs.checked 7 Oct 2026
License
The project states that sql.js is MIT licensed.checked 7 Oct 2026
Performance limit
The README says a native SQLite binding can work directly with database files and avoid loading the entire database into memory, while sql.js may encounter out-of-memory errors.checked 7 Oct 2026
Purpose
sql.js is a JavaScript library for creating and querying SQLite databases in a browser.checked 7 Oct 2026
SQL API
The API supports running SQL, preparing statements, binding parameters, and reading query results.checked 7 Oct 2026
SQL features
The API supports prepared statements and custom JavaScript functions and aggregate functions in SQL.checked 7 Oct 2026
Technology
It compiles SQLite to WebAssembly and includes an asm.js build for compatibility with older browsers.checked 7 Oct 2026
Web workers
A Web Worker build can run CPU-intensive SQL queries off the main application thread, with a more limited API.checked 7 Oct 2026

Alternatives to sql.js

All alternatives
  1. 1Chroma logo

    Chroma

    Free planOpen sourceAndroidiOSWebAPI
    8.6From $250 a month
  2. 2SQLite logo

    SQLite

    Free planOpen sourceAndroidiOSWebAPI
    8.6Free plan
  3. 3HSQLDB logo

    HSQLDB

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    8.1From $100 a year
  4. 4RxDB logo

    RxDB

    Free planAndroidiOSWebAPI
    7.5From $99 a month
  5. 5

    LadybugDB

    Free planAndroidiOSWebAPI
    7.4Free plan
  6. 6

    RocksDB

    Free planiOSAPILinuxmacOS
    7.0Free plan