Open regularfellow opened 2 years ago
It's quite common for Postgres not to report nullability of columns directly unfortunately. See #367 and #1126 as some examples.
Alternatively, try this query, which should produce the same results but generate a query plan that's much friendlier to the heuristics:
SELECT todos.*
FROM todo_things
INNER JOIN todos ON todo_things.todo_id = todos.id
When selecting rows using WHERE IN (SUBQUERY) sqlx erroneously(?) tries to return the rows with every field as nullable:
https://github.com/regularfellow/todos-example/blob/c74f96319e15c2b181f140c0f7e497a5ccd8ac05/src/main.rs#L19-L22
Example repo can be found from https://github.com/regularfellow/todos-example if helpful.