Registry / database / sqlime

sqlime

JSON →
library0.1.5jsnpmunverified

Sqlime is an online SQLite playground for debugging and sharing SQL snippets, similar to JSFiddle but for SQL. Version 0.1.5 (stable, infrequent releases) runs entirely in the browser with no server, backed by the latest SQLite via sqlean.js including extensions for math, regex, hash functions, and dynamic SQL. Key differentiators: supports connecting any local/remote SQLite database, saves to GitHub gists, includes AI assistance via OpenAI, mobile-friendly, and has zero third-party dependencies (only SQLite). Interactive widgets allow embedding live SQL examples in documentation.

npm install sqlime
INSTALL
IMPORT
SIG · SQLIME
S
sqlime
databasejavascriptv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Sqlime
import Sqlime from 'sqlime'
const Sqlime = require('sqlime')
Default ESM export; CJS not supported.
Widget
import { Widget } from 'sqlime'
import Widget from 'sqlime/Widget'
Named export for interactive widget.
version
import { version } from 'sqlime'
import v from 'sqlime'
Named export for version string.

Creates a Sqlime editor, executes SQL queries, loads a remote database, and shares as a gist.

import Sqlime from 'sqlime'; // Create a new Sqlime instance with an in-memory database const editor = new Sqlime({ element: document.getElementById('editor'), database: ':memory:', theme: 'light', aiApiKey: process.env.OPENAI_API_KEY ?? '' }); // Execute a SQL query and show results editor.execute('CREATE TABLE demo (id INTEGER PRIMARY KEY, name TEXT);'); editor.execute("INSERT INTO demo VALUES (1, 'Alice'), (2, 'Bob');"); editor.execute('SELECT * FROM demo;'); // Load a database from URL await editor.load('https://raw.githubusercontent.com/nalgeon/sqliter/main/employees.en.db'); // Share as GitHub gist erator.share();
Debug
Known issues
gotchaSqlime uses SQLite via WebAssembly; large databases (>100MB) may cause browser memory issues.
fix
Use smaller databases or paginate queries.
affects: 0.x
gotchaGitHub gist sharing requires personal access token with gist scope; not automatically set.
fix
Provide token via Sqlime config or environment variable.
affects: >=0.0.1
deprecatedThe 'ai' feature is in beta and may change API in future releases.
fix
Check documentation for updates before using AI in production.
affects: >=0.1.0
gotchaInteractive widgets require a server (e.g., GitHub Pages) to serve the app; not for local files.
fix
Deploy Sqlime on a web server or use the hosted version at sqlime.org.
affects: >=0.1.0
Errors
Common errors & fixes
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'open')
WebAssembly not loaded or database file missing.
fix
Ensure sqlite.wasm is served correctly and the database path is valid.
Failed to fetch gist: 401 Unauthorized
GitHub personal access token missing or invalid.
fix
Provide a valid token with 'gist' scope in Sqlime constructor.
This application does not have permission to access OpenAI API.
OpenAI API key missing or incorrect.
fix
Set aiApiKey option with a valid OpenAI API key.
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies
sql.jsrequiredSQLite compiled to WebAssembly (via sqlean.js)
Agent activity
15 hits · last 30 days
node
12
Meta
1
OpenAI (training)
1
Resources
packagesqlime
sqlime — npm install sqlime · libregistry