Discussion:
mapping an sqlite3 table of files as files on the file system
(too old to reply)
Johanne Fairchild
2024-09-10 23:30:01 UTC
Permalink
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this? It seems to me that I
would have to.
Lawrence D'Oliveiro
2024-09-10 23:38:36 UTC
Permalink
Post by Johanne Fairchild
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this?
You could do something via FUSE. That allows you to implement your code
entirely as a userland process.
Janis Papanagnou
2024-09-11 00:43:05 UTC
Permalink
Post by Johanne Fairchild
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this? It seems to me that I
would have to.
An interesting question. - Being curious I searched for "mount sqlite
on file system" and got a couple links; the first one was
https://adamobeng.com/wddbfs-mount-a-sqlite-database-as-a-filesystem/
Maybe it's of some use. (Or maybe some other links of that search.)

Janis
M***@dastardlyhq.com
2024-09-11 07:11:48 UTC
Permalink
On Wed, 11 Sep 2024 02:43:05 +0200
Post by Janis Papanagnou
Post by Johanne Fairchild
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this? It seems to me that I
would have to.
An interesting question. - Being curious I searched for "mount sqlite
on file system" and got a couple links; the first one was
https://adamobeng.com/wddbfs-mount-a-sqlite-database-as-a-filesystem/
Maybe it's of some use. (Or maybe some other links of that search.)
Don't see how you interact with it using any of the normal toolset unless you
map table -> directory and column -> file though it would be a very clunky
and inefficient way to use a relational DB.
Kenny McCormack
2024-09-11 11:13:13 UTC
Permalink
Post by M***@dastardlyhq.com
On Wed, 11 Sep 2024 02:43:05 +0200
Post by Janis Papanagnou
Post by Johanne Fairchild
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this? It seems to me that I
would have to.
An interesting question. - Being curious I searched for "mount sqlite
on file system" and got a couple links; the first one was
https://adamobeng.com/wddbfs-mount-a-sqlite-database-as-a-filesystem/
Maybe it's of some use. (Or maybe some other links of that search.)
Don't see how you interact with it using any of the normal toolset unless you
map table -> directory and column -> file though it would be a very clunky
and inefficient way to use a relational DB.
I can't quite tell from your post whether or not you actually read the link
given above. I just did and (tl;dr) basically agree with you that it looks
clunky, but I suppose that a) It is intended as proof-of-concept and b)
It's the sort of thing that appeals to people who like "Everything is a web
app" kind of thinking. I'm guessing that neither you nor I fall into that
classification.

That said, it looks like it is a two-step process:

1) You run his little utility - which is, of course, a black box to
most of us. It looks like it is written in Python, so it would be,
in theory at least, readable/understandable as-is. I.e., don't
need to go looking around for the source.

2) Then you "mount" it ("it" being the output of the previous step)
somewhere on the filesystem, and then you get what you want.

The details of step 2 are not specified; you are expected to already know
all about how that stuff (mounting "WebDAV" thingies) works already.

So, all in all, probably not of much use to either you or I.
--
Treating the stock market indexes as general measures of the well-being of a
society is like treating your blood pressure as an indicator of health. The
higher, the better, right? In fact, a high stock market is good for the investor
class, but it means the rest of us are getting screwed better than ever.
M***@dastardlyhq.com
2024-09-11 12:25:32 UTC
Permalink
On Wed, 11 Sep 2024 11:13:13 -0000 (UTC)
Post by Kenny McCormack
Post by M***@dastardlyhq.com
On Wed, 11 Sep 2024 02:43:05 +0200
Post by Janis Papanagnou
Post by Johanne Fairchild
Suppose I have a series of text files stored in an sqlite3 table. Can I
somehow read these files as if they're files on a certain directory?
Would I have to write a kernel driver for this? It seems to me that I
would have to.
An interesting question. - Being curious I searched for "mount sqlite
on file system" and got a couple links; the first one was
https://adamobeng.com/wddbfs-mount-a-sqlite-database-as-a-filesystem/
Maybe it's of some use. (Or maybe some other links of that search.)
Don't see how you interact with it using any of the normal toolset unless you
map table -> directory and column -> file though it would be a very clunky
and inefficient way to use a relational DB.
I can't quite tell from your post whether or not you actually read the link
given above. I just did and (tl;dr) basically agree with you that it looks
I did but I've never used sqllite so I don't know what the json , tsv etc files
signify.
Post by Kenny McCormack
clunky, but I suppose that a) It is intended as proof-of-concept and b)
It's the sort of thing that appeals to people who like "Everything is a web
app" kind of thinking. I'm guessing that neither you nor I fall into that
Yes, simple text or binary protocols seem to have gone out the window. Why
bother writing a few hundred lines of C client-server socket code when you can
waste time, resources and CPU cycles setting up a bloated web server in a
docker container and pass your data over http with all the back end nonsense
that entails getting and parsing it.

Loading...