-
-
Notifications
You must be signed in to change notification settings - Fork 807
Open
Description
Consider a database with two tables, foo and bar, and a view foo_view that joins bar to foo based on the term column (sample_data.sqlite):
create table foo(term, value);
create table bar(term, definition, bytes);
insert into foo values ("text one", 1), ("text two", 2);
insert into bar values ("text one", "definition one", x'8af8ab88'), ("text two", "definition two", x'98246547');
create view foo_view as select foo.*, bar.* from foo join bar on foo.term = bar.term;If I inspect this with datasette:
sqlite3 sample_data.db <sample_data.sqlite
datasette sample_data.dband click on the foo_view table, the UI displays Error 500: No item with that key. The stacktrace in the terminal traces the IndexError to line 182 here:
datasette/datasette/utils/__init__.py
Lines 178 to 186 in 2125115
| def path_from_row_pks(row, pks, use_rowid, quote=True): | |
| """Generate an optionally tilde-encoded unique identifier | |
| for a row from its primary keys.""" | |
| if use_rowid: | |
| bits = [row["rowid"]] | |
| else: | |
| bits = [ | |
| row[pk]["value"] if isinstance(row[pk], dict) else row[pk] for pk in pks | |
| ] |
This error occurs only when there is a blob column in foo.
The view loads just fine in the sqlite console:
sqlite> select * from foo_view;
text one|1|text one|definition one|����
text two|2|text two|definition two|�$eGEnvironment info
$ datasette --version
datasette, version 1.0a22
$ python --version
Python 3.13.7
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 25.10"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels