fix(qe): Change Array(None) to return Null value.
Description
In PostgreSQL, a nullable array column can hold either a null value or an empty array ({}), and these are semantically different. Previously, Prisma treated both cases as an empty array. This fix ensures that when the database returns a null for a nullable array column, Prisma correctly returns a null instead of an empty list.
Related Issue
- Issue: #25482
Changes Made
- Updated the conversion logic for list fields in the SQL row conversion. The branch that previously matched any null value and returned an empty list has been modified (or removed) so that a SQL
nullis properly recognized.
Screenshots (if applicable)
Before the fix, the following query would return an empty array for a null column:
CREATE OR REPLACE TABLE nullable_array ( arr text[] );
INSERT INTO nullable_array VALUES (null);
CodSpeed Performance Report
Merging #5228 will not alter performance
Comparing igort99:fix/null-array-returned-as-empty (58949d1) with main (d8cf42b)
Summary
✅ 11 untouched benchmarks
@aqrln Thanks for comment. While working on this, I realized these changes would be breaking as many users depend on this behaviour, but I continued so I could get feedback and confirmation. I will try to scope this to raw queries only.