(Fix) Handle nullability of SQLite rowid alias columns#4088
(Fix) Handle nullability of SQLite rowid alias columns#4088abonander merged 3 commits intolaunchbadge:mainfrom
Conversation
|
The explain.rs changes look reasonable to me. But I haven't touched sqlx in a long time, so I won't try to guess whether returning None from handle.rs column_nullable could lead to surprises. I initially assumed that the handle.rs is not needed for the macro magic to work. But I vaguely remember some portion of the query type describe mechanism executed select queries to sniff the results... so maybe that is what forced the handle.rs changes? |
|
The requested extra test makes sense. Will add. |
Tests the nullability of explicitly referring to the rowid column (not through an alias).
Does your PR solve an issue?
fixes #3967
Is this a breaking change?
This is a breaking change.
Previously an
INTEGER PRIMARY KEYcolumn was wrongly inferred to be nullable, so code usingquery!will break, as the result will now be ani64instead of anOption<i64>.query_as!should be fine though becauseOption<i64>implementsFrom<i64>This will apply anywhere someone has used an
INTEGER PRIMARY KEYand not overridden the nullability of that column in their queries.