Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Host full database as a static file #3

Open
izzues opened this issue Jan 24, 2022 · 1 comment
Open

Host full database as a static file #3

izzues opened this issue Jan 24, 2022 · 1 comment

Comments

@izzues
Copy link

izzues commented Jan 24, 2022

Hey, thanks for the great work!

Have you seen this?

https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/

The basic idea is that it's possible to host an entire SQLite database on GitHub Pages and query it using HTTP Range requests (so there's no need to download the entire database).

This might be a great way to make the data more accessible and especially relevant to mach-nix since querying the database can be made significantly faster for slower connections. Also relevant to #1.

What do you think?

@DavHau
Copy link
Owner

DavHau commented Feb 8, 2022

The problem I see with this is that we cannot do arbitrary web requests during a nix build without providing the sha256 for the response upfront. We would basically need to provide a sha256 for every possible answer of this sql database.
I don't see a way how this could be implemented as a nix build.

We could do what many nixpkgs fetchers do:
Write a nix expression with an empty hash -> execute the build -> let the build fail with hash mismatch -> enter the correct hash -> rebuild.
Whenever the requirements or database version is updated, the user would have to go through this process again.
Alternatively we could automate that via tooling, but then maintaining a mach-nix environment requires an external tool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants