SQLite Forum

Have sqlite3_deserialize() create new attached DBs
Login

Have sqlite3_deserialize() create new attached DBs

(1) By ddevienne on 2021-09-08 14:28:56 [source]

Hi. I'm using the zipfile extension and sqlite3_deserialize() together (both for the first time), and they are great. Thanks for them!

But one thing that surprised me, was that the 2nd arg to sqlite3_deserialize() cannot be a new name.
I've worked around that, but using a dummy "attach 'file:foo?mode=memory' as foo, so I can use "foo" as that 2nd arg.
Repeating with bar, baz, etc... for the other DBs I attach to the main memory DB.

But my question is why not simply do the attach directly in the API?
That way, no need to create an empty throw-away memory DB for nothing, no?