New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output binary columns in "sqlite-utils query" JSON #125
Labels
bug
Something isn't working
Comments
Best solution I can think of is to return the data as base64. It's a bit nasty since it means you can't round trip it back again. |
I could solve round tripping (at least a bit) by allowing insert to be run with a flag that says "these columns are base64 encoded, store the decoded data in a BLOB". That would solve inserting binary data using JSON too. |
I'm going to imitate how Datasette solves this problem: [
{
"name": "lorem.txt",
"mode": 33188,
"mtime": 1595805965,
"sz": 16984,
"data": {
"$base64": true,
"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"
}
}
] |
simonw
added a commit
that referenced
this issue
Jul 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You get an error if you try to run a query that returns data from a BLOB.
The text was updated successfully, but these errors were encountered: