Creating in-memory DB from a bunch of bytes
(1) By Gonzalo Diethelm (gonzus) on 2021-04-13 12:29:57 [source]
I am creating an SQLite db file with a bunch of data, and uploading that after creation (so, it is properly closed) to an S3 bucket. I can access the bucket and download the contents of the DB, create a temporary file, write the contents there, and open that file as a DB (which will be read-only). Works like a charm but forces me to create that file.
I am wondering if I could skip the process of creating the temporary file, and simply instantiate an in-memory DB with the bytes I got from S3. Is this possible? I could not find any direct API to do this (other than maybe going through the SQLite VFS layer).
(2) By anonymous on 2021-04-13 12:48:54 in reply to 1 [link] [source]
(3) By Gonzalo Diethelm (gonzus) on 2021-04-13 13:30:20 in reply to 2 [link] [source]
Oh, sqlite3_serialize / sqlite3_deserialize look exactly like what I need. Thanks for the pointers!