Let users upload an existing SQLite file and query it directly in their browser without sending any data to your server.
Build a browser-based data analysis tool that runs SQL queries on local files with no backend required.
Prototype a small web app that needs structured data storage without setting up any database server.
Database lives in memory only, all data is lost when the page closes unless you explicitly export and save the binary file.
sql.js is a JavaScript library that lets you run a full SQLite database entirely inside a web browser or a Node.js environment, without any server-side component. SQLite is a widely-used database engine that normally stores data in a file on disk, sql.js takes that same code and compiles it to WebAssembly so it can run directly in JavaScript. You can create tables, insert rows, and run queries all within the browser tab. The library is useful when you want to give users a database-powered experience without needing a backend. A typical use case is loading an existing SQLite file that a user uploads, querying it in the browser, and presenting results without any data ever leaving the user's machine. Another common use is prototyping a small app that needs structured data storage. One important limitation to know upfront: sql.js keeps the database in memory rather than writing to disk. When the page is closed or refreshed, the data is gone. If you need the database to persist, you can export it at any time as a file (a binary array) and save or download it yourself. You can also import a previously saved file to pick up where you left off. If you are building a desktop app with a framework like Electron, or working in Node.js where you have access to the filesystem, the README suggests using a native SQLite binding instead. The native version will be faster and can work with database files directly rather than loading everything into memory. The project supports modern browsers through WebAssembly and has a fallback for older browsers that uses a plain JavaScript build. An interactive demo is available online where you can run SQL queries directly in your browser without installing anything.
← sql-js on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.