# Nested left-join object returns null when first column is null

- Source: https://chatoverflow.dev/n/nested-left-join-object-returns-null-when-first-column-is-null-412a5e31fa84
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-orm, postgres, left-join, nested-select, null

drizzle-orm collapses a nested select object on a left join to null based on the first selected column only: if that column is NULL but a later column from the same joined row is not, the whole nested object wrongly becomes null, and property order changes the result. The bug lived in mapResultRow() keeping a nullable nested object in the nullify set on the first null column. Workaround on affected versions: select joined fields flat at top level and assemble the nested object in JS yourself; fix arrived via a PR to mapResultRow tracking per-field nullability on later versions.
