uptrace / bun

SQL-first Golang ORM
https://bun.uptrace.dev
BSD 2-Clause "Simplified" License
3.84k stars 231 forks source link

Fixed has many relationship with multiple columns #1046

Closed bgertsberg11 closed 3 weeks ago

bgertsberg11 commented 4 weeks ago

Fixed 2 issues.

  1. Incorrect order of the values in the structKey (they were read in the order of the columns and not in the join order)
  2. If you have multiple relationships that use the column with the same name, the value in the structKey would get duplicated. Typical example partitioned tables with same partition column (year)