This project demonstrates the use of SQLite with WebAssembly (WASM) and Origin Private File System (OPFS) within a React application. It allows you to run SQL queries directly in the browser.
- React + Vite app for a blazing-fast development experience.
- Supports SQLite databases in the browser via WASM.
- Stores databases in the OPFS for persistent file handling.
- Easily switch between databases to run custom SQL queries.
To get started, clone the repository and install the dependencies:
npm installStart the development server by running:
npm run devThe application will be available at http://localhost:3000 (or the port specified by Vite).
- The application ships with a dummy database (
mydb.sqlite), which is loaded by default. - You can execute SQL queries against this database directly in the app interface.
If you want to use a different SQLite database, simply upload the new .sqlite file through the app interface and start querying on it right away.
- React: Frontend framework for building user interfaces.
- Vite: Fast build tool optimized for modern JavaScript development.
- SQLite + WASM: Enables SQLite to run in the browser via WebAssembly.
- OPFS: Provides secure and persistent file storage within the browser.
Feel free to contribute to the project! To modify or extend it:
- Fork the repository.
- Create a new feature branch.
- Make your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.