uptrace / bun

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

feat: add an ordered map to remove unnecessary dependencies #1074

Closed Tiscs closed 1 week ago

Tiscs commented 1 week ago

In a past commit (https://github.com/uptrace/bun/commit/a08c009c58bf3283ce0d39d4aff04beaeff58417), a non-tagged version of go-ordered-map v2 was introduced, but only for the ordered traversal of the table and column information, and some unnecessary indirect dependencies were introduced.

This PR provides an in-package ordered map implementation so that go-ordered-map v2 and its related dependencies can be removed, and returned to go 1.22, which is still widely used.

j2gg0s commented 1 week ago

@Tiscs

Do you mind handling the updates on master?

Tiscs commented 1 week ago

@Tiscs

Do you mind handling the updates on master?

Rebased to uptrace/bun:master now.

j2gg0s commented 1 week ago

@vmihailenco Should we consider compatibility with at least two minor go versions?

vmihailenco commented 1 week ago

@vmihailenco Should we consider compatibility with at least two minor go versions?

Yes, let's do it.

The old map implementation was actually compatible with Go 1.22, but I've used new Go iterators which are 1.23+ only. But the new map is also fine.