将Bloite数据从SQLite数据库保存到文件中

Fel*_*ipe 4 ruby sqlite blob

我正在尝试将blob数据从SQLite数据库(Safari缓存:Cache.db)保存到文件中,但由于某种原因,sqlite不会读取整个blob.我最终想在ruby中这样做,但是现在直接在sqlite命令提示符下工作的东西很好.此外,我已经在stackoverflow上阅读了所有关于此内容的条目,但是大多数条目只讨论了在blob中保存图像的性能以及确保将blob保存到文件的一个条目是在C#中没有帮助我.这是我尝试过的:

sqlite> select*from cfurl_cache_response limit 1; 3501 | 0 | 945281827 | 0 | http://www.gospelz.com/components/com_jomcomment/smilies/guest.gif | 2010-02-24 16:20:07

sqlite>从cfurl_cache_blob_data中选择receiver_data,其中entry_ID = 3501;
的GIF89a(

原始(guest.gif)文件的hexdump显示sqlite在第一个空值后停止读取blob:

$ hexdump -C guest.gif
00000000 47 49 46 38 39 61 28 00 28 00 f7 00 00 f1 f5 fd | GIF89a(.(.......)

sqlite> .output test.gif
sqlite>从cfurl_cache_blob_data中选择receiver_data,其中entry_ID = 3501;
$ hexdump -C test.gif
00000000 47 49 46 38 39 61 28 0a | GIF89a(.|

Dou*_*rie 7

SQLite3正在读取整个blob,但sqlite shell程序只显示 NUL.

要测试这个,您可以尝试:

select hex( receiver_data ) from cfurl_cache_blob_data where entry_ID = 3501;
Run Code Online (Sandbox Code Playgroud)