{"html_url": "https://github.com/simonw/sqlite-utils/issues/126#issuecomment-664106405", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/126", "id": 664106405, "node_id": "MDEyOklzc3VlQ29tbWVudDY2NDEwNjQwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-07-27T04:00:08Z", "updated_at": "2020-07-27T04:00:33Z", "author_association": "OWNER", "body": "```\r\n$ echo '[\r\n {\r\n \"name\": \"transparent.gif\",\r\n \"content\": {\r\n \"$base64\": true,\r\n \"encoded\": \"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\r\n }\r\n }\r\n]' | sqlite-utils insert trans.db files - --pk=name\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 665819048, "label": "Ability to insert binary data on the CLI using JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/126#issuecomment-664065597", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/126", "id": 664065597, "node_id": "MDEyOklzc3VlQ29tbWVudDY2NDA2NTU5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-07-27T00:51:11Z", "updated_at": "2020-07-27T00:51:11Z", "author_association": "OWNER", "body": "I'm going to implement this as the reverse of #125 - binary columns in JSON are now output like this:\r\n```json\r\n {\r\n \"name\": \"lorem.txt\",\r\n \"mode\": 33188,\r\n \"mtime\": 1595805965,\r\n \"sz\": 16984,\r\n \"data\": {\r\n \"$base64\": true,\r\n \"encoded\": \"eJzt0c1xAyEMBeC7q1ABHleR3HxNAQrIjmb4M0gelx+RTY7p4N2WBYT0vmufUknH8kq5lz5pqRFXsTOl3pYkE/NJnHXoStruJEVjc0mOCyTqq/ZMJnXEZW1Js2ZvRm5U+DPKk9hRWqjyvTFx0YfzhT6MpGmN2lR1fzxjyfVMD9dFrS+bnkleMpMam/ZGXgrX1I/K+5Au3S/9lNQRh0k4Gq/RUz8GiKfsQm+7JLsJ6fTo5JhVG00ZU76kZZkxePx49uIjnpNoJyYlWUsoaSl/CcVATje/Kxu13RANnrHweaH3V5Jh4jvGyKCnxJLiXPKhmW3fiCnG7Jql7RR3UvFo8jJ4z039dtOkTFmWzL1be9lt8A5II471m6vXy+l0BR/4wAc+8IEPfOADH/jABz7wgQ984AMf+MAHPvCBD3zgAx/4wAc+8IEPfOADH/jABz7wgQ984AMf+MAHPvCBD3zgAx/4wAc+8IEPfOADH/jABz7wgQ984PuP7xubBoN9\"\r\n }\r\n }\r\n]\r\n```\r\nSo the `sqlite-utils insert` command should learn to spot `{\"$base64\": true...}` values and base64 decode them before inserting them.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 665819048, "label": "Ability to insert binary data on the CLI using JSON"}, "performed_via_github_app": null}