Page 1 of 1

SQLite + large binaries

Posted: Sun May 02, 2004 9:51 pm
by freedimension
Has somebody an Idea or a ready-to-use solution of Inserting binaries >64k into a sqlite-database via El_Chonis lib.




@El_Choni: How far is the new lib-version currently (0-99%) ;-?

Posted: Sun May 02, 2004 9:55 pm
by Karbon
I'm not doing > 64k, but I'm using it to store image files.. I base64encode() them before inserting the data.. It's a kludge but SQLite doesn't have any real support for binary data that I'm aware of. It might be possible to get around the 64k limit with this : viewtopic.php?t=9194&highlight=64k+string (and encoding the data)

Posted: Sun May 02, 2004 10:08 pm
by freedimension
Now, the Problem is, that I want to include some Sound-Files in a Database that otherwise had to be kept extern. For portability issues it would be nice to keep all of the data in one large file.

I imagined something like allocating Memory, setting the start of the block to "UPDATE ...", then reading, parsing (masking \0) and appending the binary and finally calling SQLiteExec with this homemade string. But I have no idea whether it will work if the string is larger than 64,000 bytes?
Other way would be to UPDATE the field piece by piece:
"UPDATE tbl SET a=a+piece".

Next question: what do I do to retrieve the binary?