From: "Johannes Grødem" <fjas@grdm.no>
To: 54591@debbugs.gnu.org
Subject: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string
Date: Fri, 01 Apr 2022 20:34:49 +0200 [thread overview]
Message-ID: <878rso7iuu.fsf@flokut.localdomain> (raw)
In-Reply-To: <C353DC4E-D4B0-4A0C-B4A9-E7A942B37A88@gmail.com>
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> (Of course, if there's a way of knowing the type, we could DTRT
>> automatically for each type.)
>
> Yes, I'm hoping somebody else could have a look at the sqlite
> documentation and tell me I'm missing some obvious way to get that
> information. :-)
I might be misunderstanding the issue, but SQLite column types are more
like documentation than actual rules to be enforced, unless STRICT
tables are enabled.
https://www.sqlite.org/datatype3.html
In Python's SQLite3 API, ordinary strings are inserted as SQLite TEXTs
and bytestrings are inserted as SQLite BLOBs, and returned as the same
when you query. It's using a function similar to row_to_value for this,
except that it for some reason doesn't switch on SQLITE_BLOB, it just
calls sqlite3_column_blob and tests if it returns NULL or not and then
it does a switch on the remaining types.
Couldn't the Emacs interface just use vectors of byte values for BLOBs
both ways? Or is there another data type that makes more sense?
By the way, if you want to insert BLOBs in the query itself you can do
it like this, but I guess this doesn't need Emacs support, except maybe
a helper function for the conversion:
INSERT INTO foo VALUES (X'deadcafe');
next prev parent reply other threads:[~2022-04-01 18:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-27 5:49 bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Yuan Fu
2022-03-27 6:40 ` Eli Zaretskii
2022-03-27 12:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-27 14:56 ` Eli Zaretskii
2022-03-29 14:38 ` Lars Ingebrigtsen
2022-03-29 15:38 ` Eli Zaretskii
2022-03-31 11:54 ` Lars Ingebrigtsen
2022-04-01 18:34 ` Johannes Grødem [this message]
2022-04-02 5:31 ` Eli Zaretskii
2022-04-02 6:33 ` Johannes Grødem
2022-04-02 6:52 ` Eli Zaretskii
2022-04-02 12:59 ` Lars Ingebrigtsen
2022-04-02 13:51 ` Eli Zaretskii
2022-04-02 13:59 ` Lars Ingebrigtsen
2022-04-02 14:22 ` Eli Zaretskii
2022-04-02 14:38 ` Lars Ingebrigtsen
2022-04-02 15:26 ` Eli Zaretskii
2022-04-02 15:28 ` Lars Ingebrigtsen
2022-04-02 15:40 ` Lars Ingebrigtsen
2022-04-03 10:42 ` Rudolf Schlatte
2022-04-03 11:43 ` Lars Ingebrigtsen
2022-04-02 14:06 ` Lars Ingebrigtsen
2022-04-28 12:58 ` Lars Ingebrigtsen
2022-04-29 4:59 ` Yuan Fu
2022-04-29 10:04 ` Lars Ingebrigtsen
2022-04-30 5:27 ` Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878rso7iuu.fsf@flokut.localdomain \
--to=fjas@grdm.no \
--cc=54591@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).