Commit eff6fa4
fix(selfhost): make PgStatement.first() coalesce to null like the D1 adapter (#8411)
PgStatement.first(colName) returned row[colName] uncoalesced, so an absent
column (or a driver representing SQL NULL as undefined) leaked undefined
through the documented Promise<T | null> contract, diverging from
d1-adapter.ts's first() -- the reference implementation callers rely on when
treating the two backends interchangeably via backend-contracts.ts.
Applies the same ?? null coalesce the D1 sibling already uses. Adds the
NULL-value and absent-column parity tests the pg suite was missing (the D1
suite has had the equivalent NULL test all along).
Closes #8361
Co-authored-by: RealDiligent <nft.gold.eth@gmail.com>1 parent cad1763 commit eff6fa4
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
| |||
0 commit comments