sql.js

SQLite compiled to WebAssembly, runnable in browsers and Node.js without native bindings. Provides a full SQLite engine entirely in JavaScript/WASM — supports the complete SQL dialect, transactions, and in-memory or file-based databases (via Uint8Array export/import). Powers in-browser SQL tools and agent environments that can't use native modules.

Evaluated Mar 06, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Databases sqlite webassembly browser sql embedded in-memory wasm
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
91
/ 100
Is it safe for agents?
⚡ Reliability
82
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
80
Error Messages
78
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
90
Scope Granularity
90
Dep. Hygiene
82
Secret Handling
90

Runs entirely in browser sandbox — no server-side risk. SQL injection is still possible if user input is concatenated into queries — always use prepared statements. WASM binary should be verified via integrity hash.

⚡ Reliability

Uptime/SLA
90
Version Stability
80
Breaking Changes
82
Error Recovery
78
AF Security Reliability

Best When

You need full SQLite in the browser or in a Node.js environment that can't use native modules — in-browser data analytics, offline agents, or sandboxed execution environments.

Avoid When

You're running server-side Node.js where native bindings work — use better-sqlite3 for 10-100x better performance.

Use Cases

  • Run SQL queries against structured data in browser-based agent tools without a backend database server
  • Load SQLite database files (.db) in the browser for client-side data exploration agents
  • Execute complex SQL analytics (JOINs, aggregations, window functions) in-browser without network round trips
  • Build offline-capable agents that store and query structured data entirely client-side using SQLite
  • Test SQL query logic in Node.js without native SQLite bindings (useful in CI environments with restricted native builds)

Not For

  • Production server-side SQLite — better-sqlite3 is 10-100x faster for Node.js server use due to native bindings
  • Persistent browser storage — sql.js data lives in memory and must be manually exported to IndexedDB/localStorage for persistence
  • Large datasets — WASM SQLite has higher memory overhead than native; large tables may hit browser memory limits

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local WASM library — no authentication required. Data access controlled by JavaScript execution context.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT license. SQLite itself is public domain. WASM compilation by sql-js contributors.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Database is entirely in-memory by default — must call db.export() to get Uint8Array and persist to IndexedDB/localStorage/file manually; data is lost on page refresh
  • WASM initialization is async — must await initSqlJs({ locateFile: ... }) before creating any DB instance; synchronous access before init throws
  • Result rows are returned as arrays of values, not objects — use stmt.getAsObject() or map column names manually for named-field access
  • WASM bundle is ~1MB — lazy load sql.js and consider a CDN for browser agents to avoid blocking initial load
  • sql.js uses SQLite's WAL mode limitations in WASM — concurrent access from multiple browser tabs is not supported
  • sql-js does not auto-update with SQLite releases — check which SQLite version is bundled and verify it has required features (e.g., JSON1 extension support)

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for sql.js.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-06.

5229
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered