Skip to content
 
 

Repository files navigation

SQLite-React

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.

🚀 Features

  • 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.

📦 Installation

To get started, clone the repository and install the dependencies:

npm install

🏃 Running the Application

Start the development server by running:

npm run dev

The application will be available at http://localhost:3000 (or the port specified by Vite).

🗂️ Default Database

  • 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.

🔄 Switching Databases

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.

🛠️ Technologies Used

  • 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.

👨‍💻 Development

Feel free to contribute to the project! To modify or extend it:

  1. Fork the repository.
  2. Create a new feature branch.
  3. Make your changes.
  4. Submit a pull request.

📝 License

This project is licensed under the MIT License. See the LICENSE file for more information.

📸 Screenshort

image image image

About

Example demostrate the use of SQLite with WASM and OPFS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages