When I've needed something like this in the past I've spun up simple HTML pages and used the json endpoint that all datasette instances come with [0]. I like this new pattern much better, as it keeps your app and data in one place (I remember having some issue with this at the time, though I can't remember what the actual issue was)

So I imagine we could now load some data in to sqlite, design some HTML also loaded in to the db, and deploy. Although looking at the source, it seems like stored apps are expected to be managed by the plugin itself, but I'm sure there's a way around that

[0] Eg from one of the examples - https://datasette.io/legislators/-/query.json?sql=select+*+f... . If you strip the '.json' you get the html view. For what it's worth there's also a '.csv' version.

I'm going to think about how Datasette Apps can work with the apps themselves stored on a filesystem so they can be revision controlled using Git.

I have an idea for a way to edit them through Datasette and have them backed up to Git via a separate mechanism, but having them on disk would be a whole lot more convenient.

Filed an issue here: https://github.com/datasette/datasette-apps/issues/30

Interesting idea, I know there's the fsdir [0] table-valued function / module that allows loading from disk, so it should be possible to modify that or hard-code base list of paths or something

[0] https://sqlite.org/src/file/ext/misc/fileio.c, it allows you to read a directory recursively in the cli (`select * from fsdir("./");`)

Edit: It allows upwards traversals (`select * from fsdir("../../../../etc/passwd");`), so beware

Wow, I didn't know about that one. SQLite never ceases to surprise.

I'm sticking with the Python bundled sqlite3 though so I'm not in a good place to take advantage of that one.

It's probably out of scope for you, but I've used the 'vtfunc' module [0] for a similar purpose actually.

[0] https://github.com/coleifer/sqlite-vtfunc

> it keeps your app and data in one place (I remember having some issue with this at the time, though I can't remember what the actual issue was)

CORS headers?

This seems to attractive side of seeing it, however the striping Json would not be suitable i believe

[flagged]