Added
- Generated
dberrorspackages now include generic and per-table check-constraint errors for PostgreSQL, matched by constraint name forpqandpgxdrivers. (thanks @keithbro-imx)
Changed
- PostgreSQL single-column slice relationship loaders (
<Parent>Slice.<Rel>) and batch counts (<Parent>Slice.LoadCount<Rel>) now de-duplicate the key array bound to= ANY($1)when the key column can contain duplicates (a non-unique foreign key). The array is only a semi-join filter, so query results are unchanged — a slice of 10,000 parents sharing 50 related rows now binds 50 keys instead of 10,000. Keys that are unique by construction (the parent's own primary key or a uniquely-constrained column) and key types not comparable with==keep the previous plain loop, decided at codegen time (#740). (thanks @sandonemaki) - Generated through-relationship loaders (
Load<Rel>) no longer apply every query mod twice (once against a throwaway query to detect whether the user set columns, then again for real). The default columns are now added by a deferredbob.ModFuncduring the single real application — the same patternView.Queryuses — and the join-key slice is pre-allocated to the parent slice length. Generated SQL is unchanged (#740). (thanks @sandonemaki)
Fixed
- Fixed the PostgreSQL code generator's query parser renumbering each reference to a repeated query parameter (
$N) as a distinct argument (e.g.id = $1 OR parent_id = $1generating$1/$2), which changed the meaning of the generated query mods. Repeated$Nreferences now map to a single generated parameter (#745). (thanks @dmakushin)
New Contributors
- @dmakushin made their first contribution in #745
- @keithbro-imx made their first contribution in #717
Full Changelog: v0.49.0...v0.50.0