This repo only wants to be a super simple test of sqlite, Github Actions and Github Pages! A Github Action adds random records on a sqlite db every 6 hours. Then a Typescript page, compiled in WebAssembly, displays data randomly using sql.js-httpvfs (a wrapper around sql.js to provide a read-only HTTP-Range-request based virtual file system for SQLite). sql.js-httpvfs is amazing because allows hosting an SQLite database on a static file hoster and querying that database from the browser without fully downloading it.
In the package.json you can find a script to help you during the development process. You only need to launch the following commands in your Linux terminal (WSL as well).
npm install # if needed
npm run dev
If you want to build this you need to run the following commands:
cd ./ui
npm install # if needed
npm run build-prod
Thanks to a Github Action, every push on master launches a job that deployes a build on the branch "gh-pages". In this way you can have a working version of this repo on the following url: https://ilmalte.github.io/github-actions-with-sqlite/
Here you can find the documentation for the SQLite project's WebAssembly- and JavaScript-related APIs, which enable the use of sqlite3 in modern WASM-capable browsers: https://sqlite.org/wasm/doc/trunk/index.md