Open simonw opened 1 year ago
https://latest.datasette.io/fixtures doesn't currently have a view with any integer columns in it, making this bug harder to demonstrate there.
I can't replicate the bug using https://datasette.io/content/plugins?_facet=stargazers_count&stargazers_count=3 - I would expect that not to work correctly.
Here's a demo of this breaking in Datasette Lite:
Here's a SQL query that demonstrates the underlying issue:
select 'working', count(*) from baseline where is_baseline = 1
union all
select 'broken', count(*) from baseline where is_baseline = '1'
Spotted this issue here: https://til.simonwillison.net/datasette/baseline
I had to do this workaround:
I think the core issue here is that, against a table,
select * from x where integer_column = '1'
works correctly, due to some kind of column type conversion mechanism... but this mechanism doesn't work against views.