Save user data as a new “project file” file extension (bad title, see post)

Hi,

Sorry for the bad title :slight_smile:

I have an Electron app that is powered by rust where the user can create/open her “projects” which right now is just folders which has an SQL lite database, some json files and attachments.

Now I would like to save these projects under a new extension, as a single file instead of folders similar to how you would open say a PowerPoint file.

My initial thought was to zip the project directory and basically create a zip file with the data and just rename it to a new extension.

Anyone has similar experiences? Any common gotchas? I’m a bit afraid of latency because the SQLite file would be called a lot (on pretty much every user click) but that could perhaps be compared by storing it as a zip but without actual compression (to make it faster to read). It would still need to scan the zip file and get the underlying SQLite though.

Does that makes sense at all? Should I do something completely different?

Regards,
Niklas

Have you considered just making your file format a single SQLite database? And storing attachments and files as blobs in a table. That seems like it should be simpler

4 Likes

Yeah, I’ve thought of that. Maybe that is the easiest. I’m just scared of binary data in SQL, but given that everything is local anyway it won’t matter as much

FYI, the SQLite site has a whole page on using a database as a file format that you might find interesting link

1 Like

Really neat, thank you so much. That will be the approach I’m going for then

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.