Simple but deceptively difficult question:
I got what I was trying to get working here: Using OPFS (Origin Private FileSystem) with SQLite WASM in background.js Chrome Extention (Worker is not defined error)
But, I can't seem to find where the .sqlite3 file is stored?
I have tried sudo find / -type f -name "mydb.sqlite3"
and sudo find / -type f -name "*.sqlite3"
searching the entire computer for the file but it doesn't seem to be found. This tells me I must be missing something fundamental about this?
I know the database is remembering data somehow because I can view the console messages after refreshing the extention and see more and more rows when I read the database.
I have tried the OPFS extention to try viewing the database but that doesn't work either (refer to screenshot)
I feel like a complete idiot that I can't figure out where this file is being stored. Anyone know? I just want to be able to view it with an SQLite reader and verify everything is storing correctly in an easier manner. Currently I can query it using SQL commands to verify it works but this is very slow and tedious and I feel unnecessary. In my screenshot it says LIMIT 3, but I can remove that to show all rows just fine just FYI
At least going by the spec, OPFS files cannot be located on file system of the operating system. The actual storage of files and their location is implementation details of browser.
from the MDN docs:
Browsers persist the contents of the OPFS to disk somewhere, but you cannot expect to find the created files matched one-to-one. The OPFS is not intended to be visible to the user.
If you want to export file, you need to write code for reading the file from OPFS & download on to user's file system (on some event, like click of a button). However, OPFS file can't be automatically sync'ed with a file on the OS file system