{"repo":"sqlite/sqlite-wasm","free":true,"listed":false,"github":"https://github.com/sqlite/sqlite-wasm","clone":"git clone https://github.com/sqlite/sqlite-wasm.git","description":"SQLite Wasm conveniently wrapped as an ES Module.","language":"JavaScript","stars":1040,"topics":["esm","sqlite","sqlite-wasm","webassembly","sqlite-webassembly","opfs","sqlite3","origin-private-file-system","sqlite3-wasm"],"license":null,"category":"databases-storage","readme_excerpt":"SQLite Wasm SQLite Wasm conveniently wrapped as an ES Module. Installation Bug reports [!Warning] This project wraps the code of SQLite Wasm with no changes, apart from added TypeScript types. Please do not file issues or feature requests regarding the underlying SQLite Wasm code here. Instead, please follow the SQLite bug filing instructions. Filing TypeScript type related issues and feature requests is fine. Node.js support [!Warning] Node.js is currently only supported for in-memory databases without persistence. Usage There are two ways to use SQLite Wasm: - in a worker - in the main thread Only the worker versions allow you to use the origin private file system (OPFS) storage back-end. In a worker (with OPFS if available): [!Warning] For this to work, you need to set the following headers on your server: Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp The db object above implements the Object-Oriented API #1. In the main thread (without OPFS): The db object above implements the Object-Oriented API #1. Usage with vite If you are using vite, you need to add the following config option in vite.config.js : Check out a sample project that shows this in action. Demo See the demo folder for examples of how to use this in the main thread and in a worker. (Note that the worker variant requires special HTTP headers, so it can't be hosted on GitHub Pages.) An example that shows how to use this with vite is available on StackBlitz. Projects using t","default_branch":null,"files":null,"tree":[],"storefront":"/r/sqlite","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sqlite/sqlite-wasm/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}