Leo NTS

Leo NTS

Non

Self serving static pages with dynamic behaviour

When serving static pages one of the wanted behaviours from the user point of view is exploring the data. SQL syntax would be great to be able to do this.

For this we would need a dynamic backend that handles the queries and then answers to the frontend, except that we want to serve the pages in a static web server (like for example github pages).

Why this behaviour? because unless one wants to maintain a web server or pay a service for it the end user should not need to do this (even if this behaviour should also be better handled in datahub.io page).

While sql.js allows managing sqlite3 databases with javascript and can be used in the frontend (web-browser) it needs to load the complete sqlite3 file, there is an extension that allows to partially load sqlite3 files in the web browser from static servers sql.js-httpvfs, with a good read on how to use it [here](https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/ there the post and here the repo)

With this we can do SQL queries directly on a sqlite3 database.

For local DB with reads and writes there is https://github.com/jlongster/absurd-sql but it doesn't seem to play well with the other sqlite httpvfs system

© 2024 All rights reservedBuilt with Find, Share and Publish Quality Data with Datahub

Built with Find, Share and Publish Quality Data with DatahubFind, Share and Publish Quality Data with Datahub