How to dump a file stored in a sqlite database as a blob?

前端 未结 4 695
慢半拍i
慢半拍i 2020-12-13 06:32

I have a sqlite3 database. One column has the TEXT type, and contains blobs which I would like to save as file. Those are gzipped files.

The output of the command

4条回答
  •  一个人的身影
    2020-12-13 07:18

    In my case, I use "hex" instead of "quote" to retrieve image from database, and no need "cut" in the command pipe. For example:

    sqlite3 fr.db "select hex(bmp) from reg where id=1" | xxd -r -p > 2.png
    

提交回复
热议问题