Closed Trinitek closed 7 months ago
No problem with bringing sqlite3_free
further up.
If you do end up submitting a PR, I'll give it a look.
I would love to use the sqlite3_serialize() method. My use-case is as follows: My app works on a local SQLite database, which contents can by synced through the Cloud. However, that database is potentially very large and has to be split up before uploading (in my case, I completely strip the table that contains large file BLOBs). The most efficient way I have found to do that is creating a second database file, attaching it to the main database and then transfer all tables over (except the one with the file BLOBs). After that, the file is read into memory and uploaded to the Cloud. I think performance could be further improved if that second, small database is never stored on disk in the first place, but created as in-memory database. Currently, it is not possible for me to retrieve those bytes from an in-memory database - I hope that the sqlite3_serialize() method would be able to do that.
Interesting use case.
There is a PR for this at #536 but it hasn't had any activity in a while.
I finally have some time I can work on this. I'll open a PR either today or tomorrow if #536 isn't moving.
I have some code that brings in
sqlite3_serialize()
andsqlite3_deserialize()
and usesraw.GetNativeLibraryName()
to do so dynamically, and I think it would be good to bring these into SQLitePCL officially. I have one question before I open a PR however:sqlite3_serialize()
has the potential to return a pointer that must be freed usingsqlite3_free()
. I noticed that the providers implementsqlite3_free()
but it is not exposed inraw
. Do you have any objections to exposing this?