It is a bit unfortunate that one can't backup to and restore a #SQlite database from a byte buffer. Otherwise one could also use it to send serialized data over the network 🙈
Conversation
Notices
-
Embed this notice
Helge Heß (helge@mastodon.social)'s status on Wednesday, 24-Apr-2024 00:52:23 JST Helge Heß
-
Embed this notice
Paul Cantrell (inthehands@hachyderm.io)'s status on Wednesday, 24-Apr-2024 00:52:22 JST Paul Cantrell
@helge It’s just a single file, right? I mean…
-
Embed this notice
Helge Heß (helge@mastodon.social)'s status on Wednesday, 24-Apr-2024 03:34:50 JST Helge Heß
@finestructure @inthehands This is not the ask, SQLite has an in-memory DB which that stuff is probably using.
The question is how to serialize that in-memory SQLite DB to say a `Data`. I think the only way is to backup the DB to a file, then load the file into a Data and drop the file. -
Embed this notice
Paul Cantrell (inthehands@hachyderm.io)'s status on Wednesday, 24-Apr-2024 03:34:50 JST Paul Cantrell
@helge @finestructure
Huh, it strikes me that there could be multiple use cases for an stdlib- or OS-level “memory buffer as file” facility, either a file handle that acts on a single memory buffer or an in-memory file system. Seems like such a thing should be standard, but I don’t think I’ve ever heard of it. -
Embed this notice
Helge Heß (helge@mastodon.social)'s status on Wednesday, 24-Apr-2024 03:34:51 JST Helge Heß
@inthehands Yes, but you have to do the I/O to write it to a file, and then load it into a buffer, then delete the file. I'd like the byte representation of an in-memory db w/o doing any I/O.
-
Embed this notice
Sven A. Schmidt (finestructure@mastodon.social)'s status on Wednesday, 24-Apr-2024 03:34:51 JST Sven A. Schmidt
@helge @inthehands Vapor’s db stuff (whatever the Sqlite Fluent driver is called) has an in-memory db. Would something like that work?
-
Embed this notice