TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Wddbfs – Mount a SQLite database as a filesystem

291 pointsby vitplisterover 1 year ago

15 comments

blagieover 1 year ago
This seems really nice!<p>If this is posted by the author looking for feedback:<p>1) WebDAV is a much better choice than FUSE. FUSE is a good concept, but buggy and poorly-implemented. Things like sshfs can break in very bad ways if e.g. there is a network connectivity issue. Not a hack.<p>2) Writes seem like a very bad idea. Keep those out unless you come up with a clean way to handle them (which seems difficult if not impossible given the differences in FS versus relational abstractions, especially with regards to data validation). Not a limitation.<p>In other words, the &quot;hacks&quot; seem like design choices a good architect would likely have made. Continuing:<p>3) The major use-case I have is if I have a small (&lt;1MB) database, and don&#x27;t know the structure. Lots of tools use small sqlite databases. There is no way to query all tables for something, whereas tools like `find` and `grep` can look through all files. I was recently trying to recover some lost data, and it was a pain to find it.<p>4) I think a major theoretical question is how to fuse the two models. I would like to be able to do &#x27;generic&#x27; things like the above on databases, while still being able to be relational.<p>5) I don&#x27;t have an answer to the above, but perhaps natural first step might be to allow something like queries or virtual tables to sit on the file system:<p>wddbfs --anonymous --db-path=&#x2F;path&#x2F;to&#x2F;an&#x2F;example&#x2F;database&#x2F;like&#x2F;Chinook_Sqlite.sqlite<p>wddbfs_query myjoin &quot;SELECT * FROM table_1, table_2 WHERE table_1.id=table_2.id&quot;<p>And voila! A &#x2F;virtual&#x2F;myjoin.csv file pops up.<p>(Even more) half-baked thoughts:<p>There might be more clever ways to do it too. I&#x27;m thinking through half-baked thoughts on how to make files and tab completion work. My half-baked thoughts are moving towards something like:<p>wddbfs_SELECT * from Customer.tsv\, Employee.tsv WHERE<p>But I don&#x27;t like all the potential bugs with escaping. I&#x27;m also thinking about when output wants to go to the console versus into a virtual table.
评论 #39420450 未加载
评论 #39419525 未加载
评论 #39418561 未加载
评论 #39421495 未加载
评论 #39418906 未加载
评论 #39418511 未加载
评论 #39426032 未加载
adiusover 1 year ago
I&#x27;m also working on something like this:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Airsequel&#x2F;SQLiteDAV">https:&#x2F;&#x2F;github.com&#x2F;Airsequel&#x2F;SQLiteDAV</a><p>My mapping is: table -&gt; dir, row -&gt; dir, cell -&gt; file
评论 #39419363 未加载
jFriedensreichover 1 year ago
I build a couchDB webdav server back in the day, you could also edit json documents or file blobs directly. the problem i discovered was that all OSes totally staled their webdav support and there are also enough differences between oses to be annoying. In the end to build somthing with great performance you would also need to control the webdav client side and probably build a fuse webdav client. I would have loved to see webdav maturing and becoming what the 9P vision was just for the web, but this obviously never happened as all the applications just went into to the web and used rest intead of webdav and everything else moved to sync protocols that sync to local folders.
评论 #39422373 未加载
pletnesover 1 year ago
Wrap in an SSH tunnel and you can do some fun stuff over the network, too.
评论 #39418478 未加载
renonceover 1 year ago
&gt; Although for now, the whole table gets read into memory for every read so this won’t work well for very large database files. There’s also no write support… yet.<p>At such a set of features I would prefer a tool that converts databases to a directory of real csv and jsonl files, at least there are no performance issues to worry about
AnyTimeTravelerover 1 year ago
I really like the idea of running a watch on an sqlite table with my common cli tools. If I understand correctly, it is being re-read on every request. Does that mean that changes to the sqlite database will be visible on the next read of a csv file?
yellowappleover 1 year ago
I was expecting this to be a way to mount so-called SQL Archives (<a href="https:&#x2F;&#x2F;sqlite.org&#x2F;sqlar.html" rel="nofollow">https:&#x2F;&#x2F;sqlite.org&#x2F;sqlar.html</a>) but this is just as cool.
Nicanover 1 year ago
&gt; the SQL syntax for selecting a few records is much more verbose than head -n or tail -n<p>I use DBeaver to inspect SQLite files, and to also work with Postgres databases.<p>I kind of miss MySQL Workbench, but MySQL is pretty dead to me. And SQL Server Management Studio is a relic that keeps being updated.<p>I also sometimes make dashboards from SQLite files using Grafana, but the time functions for SQLite are pretty bad.
评论 #39429354 未加载
T-Aabout 1 year ago
&gt; Part of this is avoiding the overhead of figuring out a relational schema, but an equal amount of friction comes from the fact that .sqlite files are just slightly more difficult to inspect<p>I like this solution to that problem:<p><a href="https:&#x2F;&#x2F;sqlitebrowser.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sqlitebrowser.org&#x2F;</a>
account-5over 1 year ago
This looks pretty cool.
genocidicbunnyover 1 year ago
Wasn&#x27;t there an extension that let you mount a filesystem as a table or db in sqlite? I wonder how far you can inception that. Mount a db as a filesystem, then mount that filesystem as a db..etc.
评论 #39422606 未加载
loegover 1 year ago
Cute, seems legitimately useful, succinct. Not everything has to be super technically challenging to be valuable. I can see how this would be really handy.
评论 #39422745 未加载
eternauta3kover 1 year ago
Why webdav instead of making short sqltocsv, sqltojson, etc scripts? You could make completion work (with some enormous time investment).
评论 #39418595 未加载
mharigover 1 year ago
Nice. I think exposing the tables as csv, tsv, json &amp; jsonl is to much of a cluttering. Format should be a mount option.
评论 #39418922 未加载
nikeeeover 1 year ago
Does it support mounting a sqlar file?