diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efad67bea..53e85f18b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.23.x] + go-version: [1.22.x, 1.23.x] services: postgres: diff --git a/dbfixture/go.mod b/dbfixture/go.mod index b0ea71925..10abd82db 100644 --- a/dbfixture/go.mod +++ b/dbfixture/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/dbfixture -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../ diff --git a/dialect/mssqldialect/go.mod b/dialect/mssqldialect/go.mod index c7562bf9c..2c2d6e316 100755 --- a/dialect/mssqldialect/go.mod +++ b/dialect/mssqldialect/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/dialect/mssqldialect -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/dialect/mysqldialect/go.mod b/dialect/mysqldialect/go.mod index 70e2b0a33..49e5e21bd 100644 --- a/dialect/mysqldialect/go.mod +++ b/dialect/mysqldialect/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/dialect/mysqldialect -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/dialect/oracledialect/go.mod b/dialect/oracledialect/go.mod index 611410ec2..3b861794b 100644 --- a/dialect/oracledialect/go.mod +++ b/dialect/oracledialect/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/dialect/oracledialect -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/dialect/pgdialect/go.mod b/dialect/pgdialect/go.mod index 339993b8c..1b2412aed 100644 --- a/dialect/pgdialect/go.mod +++ b/dialect/pgdialect/go.mod @@ -1,24 +1,18 @@ module github.com/uptrace/bun/dialect/pgdialect -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. require ( github.com/stretchr/testify v1.8.1 github.com/uptrace/bun v1.2.6 - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect diff --git a/dialect/pgdialect/go.sum b/dialect/pgdialect/go.sum index a373b962d..207443654 100644 --- a/dialect/pgdialect/go.sum +++ b/dialect/pgdialect/go.sum @@ -1,18 +1,11 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -32,8 +25,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/dialect/pgdialect/inspector.go b/dialect/pgdialect/inspector.go index 42bbbe84f..040df439c 100644 --- a/dialect/pgdialect/inspector.go +++ b/dialect/pgdialect/inspector.go @@ -5,8 +5,8 @@ import ( "strings" "github.com/uptrace/bun" + "github.com/uptrace/bun/internal/ordered" "github.com/uptrace/bun/migrate/sqlschema" - orderedmap "github.com/wk8/go-ordered-map/v2" ) type ( @@ -34,7 +34,7 @@ func newInspector(db *bun.DB, options ...sqlschema.InspectorOption) *Inspector { func (in *Inspector) Inspect(ctx context.Context) (sqlschema.Database, error) { dbSchema := Schema{ - Tables: orderedmap.New[string, sqlschema.Table](), + Tables: ordered.NewMap[string, sqlschema.Table](), ForeignKeys: make(map[sqlschema.ForeignKey]string), } @@ -61,7 +61,7 @@ func (in *Inspector) Inspect(ctx context.Context) (sqlschema.Database, error) { return dbSchema, err } - colDefs := orderedmap.New[string, sqlschema.Column]() + colDefs := ordered.NewMap[string, sqlschema.Column]() uniqueGroups := make(map[string][]string) for _, c := range columns { @@ -72,7 +72,7 @@ func (in *Inspector) Inspect(ctx context.Context) (sqlschema.Database, error) { def = strings.ToLower(def) } - colDefs.Set(c.Name, &Column{ + colDefs.Store(c.Name, &Column{ Name: c.Name, SQLType: c.DataType, VarcharLen: c.VarcharLen, @@ -103,7 +103,7 @@ func (in *Inspector) Inspect(ctx context.Context) (sqlschema.Database, error) { } } - dbSchema.Tables.Set(table.Name, &Table{ + dbSchema.Tables.Store(table.Name, &Table{ Schema: table.Schema, Name: table.Name, Columns: colDefs, diff --git a/dialect/sqlitedialect/go.mod b/dialect/sqlitedialect/go.mod index 91a6c40e2..a4ed9de0a 100644 --- a/dialect/sqlitedialect/go.mod +++ b/dialect/sqlitedialect/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/dialect/sqlitedialect -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/driver/pgdriver/go.mod b/driver/pgdriver/go.mod index b0a3964d0..1c836c726 100644 --- a/driver/pgdriver/go.mod +++ b/driver/pgdriver/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/driver/pgdriver -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/driver/sqliteshim/go.mod b/driver/sqliteshim/go.mod index 91d30a724..3001a0911 100644 --- a/driver/sqliteshim/go.mod +++ b/driver/sqliteshim/go.mod @@ -2,8 +2,6 @@ module github.com/uptrace/bun/driver/sqliteshim go 1.22.0 -toolchain go1.22.6 - require ( github.com/mattn/go-sqlite3 v1.14.24 github.com/stretchr/testify v1.8.1 diff --git a/example/basic/go.mod b/example/basic/go.mod index fdaaf2c1a..c0942d857 100644 --- a/example/basic/go.mod +++ b/example/basic/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/basic -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/create-table-index/go.mod b/example/create-table-index/go.mod index 5d1136724..27cf3a69d 100644 --- a/example/create-table-index/go.mod +++ b/example/create-table-index/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/create-table-index -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/cursor-pagination/go.mod b/example/cursor-pagination/go.mod index 13eb0e64d..c7a79097c 100644 --- a/example/cursor-pagination/go.mod +++ b/example/cursor-pagination/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/cursor-pagination -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/custom-type/go.mod b/example/custom-type/go.mod index f4983abc0..7ee586287 100644 --- a/example/custom-type/go.mod +++ b/example/custom-type/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/custom-type -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/fixture/go.mod b/example/fixture/go.mod index 31af8cd5d..f94a5f41f 100644 --- a/example/fixture/go.mod +++ b/example/fixture/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/fixture -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/get-where-fields/go.mod b/example/get-where-fields/go.mod index 7f2a97e27..dcf799468 100644 --- a/example/get-where-fields/go.mod +++ b/example/get-where-fields/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/get-where-fields -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/migrate/go.mod b/example/migrate/go.mod index 6ae3c86d3..d70e7fe5d 100644 --- a/example/migrate/go.mod +++ b/example/migrate/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/migrate -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. @@ -21,16 +19,12 @@ require ( ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.24 // indirect @@ -41,11 +35,9 @@ require ( github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/sys v0.27.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852 // indirect modernc.org/libc v1.61.2 // indirect modernc.org/mathutil v1.6.0 // indirect diff --git a/example/migrate/go.sum b/example/migrate/go.sum index 4612c51a4..9bc42c0c7 100644 --- a/example/migrate/go.sum +++ b/example/migrate/go.sum @@ -1,10 +1,5 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -19,11 +14,6 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -33,8 +23,6 @@ github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBW github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= @@ -53,8 +41,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= @@ -69,9 +55,6 @@ golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= modernc.org/cc/v4 v4.23.1 h1:WqJoPL3x4cUufQVHkXpXX7ThFJ1C4ik80i2eXEXbhD8= diff --git a/example/model-hooks/go.mod b/example/model-hooks/go.mod index ca218781f..bd04f1572 100644 --- a/example/model-hooks/go.mod +++ b/example/model-hooks/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/model-hooks -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/multi-tenant/go.mod b/example/multi-tenant/go.mod index 969708fa1..b83235b28 100644 --- a/example/multi-tenant/go.mod +++ b/example/multi-tenant/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/multi-tenant -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/opentelemetry/go.mod b/example/opentelemetry/go.mod index 6c07fc015..0fbc22a56 100644 --- a/example/opentelemetry/go.mod +++ b/example/opentelemetry/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/opentelemetry -go 1.23 - -toolchain go1.23.2 +go 1.22.7 // required by google.golang.org/grpc v1.68.0 replace github.com/uptrace/bun => ../.. @@ -27,21 +25,17 @@ require ( ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.2 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect go.opentelemetry.io/contrib/instrumentation/runtime v0.57.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.8.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0 // indirect @@ -63,6 +57,5 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/grpc v1.68.0 // indirect google.golang.org/protobuf v1.35.2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect mellium.im/sasl v0.3.2 // indirect ) diff --git a/example/opentelemetry/go.sum b/example/opentelemetry/go.sum index 6626637ef..aea79c924 100644 --- a/example/opentelemetry/go.sum +++ b/example/opentelemetry/go.sum @@ -1,9 +1,5 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/brianvoe/gofakeit/v5 v5.11.2 h1:Ny5Nsf4z2023ZvYP8ujW8p5B1t5sxhdFaQ/0IYXbeSA= github.com/brianvoe/gofakeit/v5 v5.11.2/go.mod h1:/ZENnKqX+XrN8SORLe/fu5lZDIo1tuPncWuRD+eyhSI= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -23,19 +19,10 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= github.com/puzpuzpuz/xsync/v3 v3.4.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= @@ -48,8 +35,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= go.opentelemetry.io/contrib/instrumentation/runtime v0.57.0 h1:kJB5wMVorwre8QzEodzTAbzm9FOOah0zvG+V4abNlEE= go.opentelemetry.io/contrib/instrumentation/runtime v0.57.0/go.mod h1:Nup4TgnOyEJWmVq9sf/ASH3ZJiAXwWHd5xZCHG7Sg9M= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -94,9 +79,6 @@ google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= mellium.im/sasl v0.3.2 h1:PT6Xp7ccn9XaXAnJ03FcEjmAn7kK1x7aoXV6F+Vmrl0= diff --git a/example/pg-faceted-search/go.mod b/example/pg-faceted-search/go.mod index bb2541a9c..bc0a54709 100644 --- a/example/pg-faceted-search/go.mod +++ b/example/pg-faceted-search/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/pg-faceted-search -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. @@ -24,18 +22,14 @@ require ( ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/sys v0.27.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/example/pg-faceted-search/go.sum b/example/pg-faceted-search/go.sum index bee65b5fa..038be79f4 100644 --- a/example/pg-faceted-search/go.sum +++ b/example/pg-faceted-search/go.sum @@ -1,18 +1,11 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -24,16 +17,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= github.com/puzpuzpuz/xsync/v3 v3.4.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/example/pg-listen/go.mod b/example/pg-listen/go.mod index 26898c11d..7400a47df 100644 --- a/example/pg-listen/go.mod +++ b/example/pg-listen/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/pg-listen -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. @@ -20,20 +18,15 @@ require ( ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/sys v0.27.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect mellium.im/sasl v0.3.2 // indirect ) diff --git a/example/pg-listen/go.sum b/example/pg-listen/go.sum index bee65b5fa..de1d1f715 100644 --- a/example/pg-listen/go.sum +++ b/example/pg-listen/go.sum @@ -1,48 +1,32 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= github.com/puzpuzpuz/xsync/v3 v3.4.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= mellium.im/sasl v0.3.2 h1:PT6Xp7ccn9XaXAnJ03FcEjmAn7kK1x7aoXV6F+Vmrl0= diff --git a/example/placeholders/go.mod b/example/placeholders/go.mod index 1e1519974..50930273b 100644 --- a/example/placeholders/go.mod +++ b/example/placeholders/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/placeholders -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-belongs-to/go.mod b/example/rel-belongs-to/go.mod index d9e85322d..ed4e337fc 100644 --- a/example/rel-belongs-to/go.mod +++ b/example/rel-belongs-to/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-belongs-to -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-has-many-polymorphic/go.mod b/example/rel-has-many-polymorphic/go.mod index b4c93a456..526f81f0d 100644 --- a/example/rel-has-many-polymorphic/go.mod +++ b/example/rel-has-many-polymorphic/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-has-many-polymorphic -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-has-many/go.mod b/example/rel-has-many/go.mod index ad9ccb559..3b34dc874 100644 --- a/example/rel-has-many/go.mod +++ b/example/rel-has-many/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-has-many -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-has-one/go.mod b/example/rel-has-one/go.mod index f04ab015b..ab324e9f2 100644 --- a/example/rel-has-one/go.mod +++ b/example/rel-has-one/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-has-one -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-join-condition/go.mod b/example/rel-join-condition/go.mod index 4912a5464..4897dab57 100644 --- a/example/rel-join-condition/go.mod +++ b/example/rel-join-condition/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-join-condition -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-many-to-many-self/go.mod b/example/rel-many-to-many-self/go.mod index b571f6221..7d8ca6f65 100644 --- a/example/rel-many-to-many-self/go.mod +++ b/example/rel-many-to-many-self/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-many-to-many-self -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/rel-many-to-many/go.mod b/example/rel-many-to-many/go.mod index 869e2d50e..ab41cd1cd 100644 --- a/example/rel-many-to-many/go.mod +++ b/example/rel-many-to-many/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/rel-many-to-many -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/string-representation/go.mod b/example/string-representation/go.mod index 278b89caf..5f6ea6976 100644 --- a/example/string-representation/go.mod +++ b/example/string-representation/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/string-representation -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/example/trivial/go.mod b/example/trivial/go.mod index 3bbda7a73..dd9e3bfa7 100644 --- a/example/trivial/go.mod +++ b/example/trivial/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/trivial -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. @@ -35,8 +33,6 @@ require ( require ( filippo.io/edwards25519 v1.1.0 // indirect - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.18.0 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect @@ -44,7 +40,6 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.24 // indirect @@ -54,12 +49,10 @@ require ( github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/sys v0.27.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect mellium.im/sasl v0.3.2 // indirect modernc.org/gc/v3 v3.0.0-20241004144649-1aea3fae8852 // indirect modernc.org/libc v1.61.2 // indirect diff --git a/example/trivial/go.sum b/example/trivial/go.sum index 3810b8a3c..f87a69de0 100644 --- a/example/trivial/go.sum +++ b/example/trivial/go.sum @@ -3,10 +3,6 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4 github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -32,11 +28,6 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -47,8 +38,6 @@ github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxU github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -58,16 +47,14 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -98,8 +85,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/example/tx-composition/go.mod b/example/tx-composition/go.mod index 8748657af..6a50a1786 100644 --- a/example/tx-composition/go.mod +++ b/example/tx-composition/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/example/tx-composition -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/extra/bunbig/go.mod b/extra/bunbig/go.mod index e852d0435..ed6a86533 100644 --- a/extra/bunbig/go.mod +++ b/extra/bunbig/go.mod @@ -1,6 +1,6 @@ module github.com/uptrace/bun/extra/bunbig -go 1.22 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/extra/bundebug/go.mod b/extra/bundebug/go.mod index ceadd8d4a..9e0b8f2e9 100644 --- a/extra/bundebug/go.mod +++ b/extra/bundebug/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/extra/bundebug -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/extra/bunotel/go.mod b/extra/bunotel/go.mod index 5d4af0d45..a7ec51730 100644 --- a/extra/bunotel/go.mod +++ b/extra/bunotel/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/extra/bunotel -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/extra/bunrelic/go.mod b/extra/bunrelic/go.mod index 1d789d821..33582852d 100644 --- a/extra/bunrelic/go.mod +++ b/extra/bunrelic/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/extra/bunrelic -go 1.23 - -toolchain go1.23.2 +go 1.22.7 // required by google.golang.org/grpc v1.68.0 replace github.com/uptrace/bun => ../.. diff --git a/extra/bunslog/go.mod b/extra/bunslog/go.mod index 669a12614..2785b7ad4 100644 --- a/extra/bunslog/go.mod +++ b/extra/bunslog/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/extra/bunslog -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. diff --git a/go.mod b/go.mod index 9c55d7dd4..48b197ab8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun -go 1.23 - -toolchain go1.23.2 +go 1.22.0 require ( github.com/jinzhu/inflection v1.0.0 @@ -11,14 +9,10 @@ require ( github.com/stretchr/testify v1.8.1 github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc github.com/vmihailenco/msgpack/v5 v5.4.1 - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect diff --git a/go.sum b/go.sum index dd8ae7543..0e97efd20 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -9,12 +5,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -44,8 +37,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/internal/dbtest/go.mod b/internal/dbtest/go.mod index c6bbaa87d..bcc3a7efa 100644 --- a/internal/dbtest/go.mod +++ b/internal/dbtest/go.mod @@ -1,8 +1,6 @@ module github.com/uptrace/bun/internal/dbtest -go 1.23 - -toolchain go1.23.2 +go 1.22.0 replace github.com/uptrace/bun => ../.. @@ -39,12 +37,9 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.2.6 github.com/uptrace/bun/driver/sqliteshim v1.2.6 github.com/uptrace/bun/extra/bundebug v1.2.6 - github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 ) require ( - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.18.0 // indirect @@ -59,7 +54,6 @@ require ( github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect github.com/jackc/pgtype v1.7.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.24 // indirect diff --git a/internal/dbtest/go.sum b/internal/dbtest/go.sum index f4da14f76..1c953c5ca 100644 --- a/internal/dbtest/go.sum +++ b/internal/dbtest/go.sum @@ -24,8 +24,6 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -34,8 +32,6 @@ github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnL github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEhYsS0dbQiS1B0/XMXl+42y9Ilk= github.com/brianvoe/gofakeit/v6 v6.4.1 h1:u4lPnxVNr648hEyoIz31A8zrQl5woUQbCgqjAj/n/Y4= github.com/brianvoe/gofakeit/v6 v6.4.1/go.mod h1:palrJUk4Fyw38zIFB/uBZqsgzW5VsNllhHKKwAebzew= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -206,7 +202,6 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -231,8 +226,6 @@ github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -378,8 +371,6 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 h1:rnB8ZLMeAr3VcqjfRkAm27qb8y6zFKNfuHvy1Gfe7KI= -github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/internal/dbtest/inspect_test.go b/internal/dbtest/inspect_test.go index 52afcbe15..fa2f8f941 100644 --- a/internal/dbtest/inspect_test.go +++ b/internal/dbtest/inspect_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" "github.com/uptrace/bun" "github.com/uptrace/bun/dialect/sqltype" + "github.com/uptrace/bun/internal/ordered" "github.com/uptrace/bun/migrate/sqlschema" "github.com/uptrace/bun/schema" - orderedmap "github.com/wk8/go-ordered-map/v2" ) type Article struct { @@ -79,22 +79,22 @@ func TestDatabaseInspector_Inspect(t *testing.T) { for _, tt := range []struct { name string schemaName string - wantTables *orderedmap.OrderedMap[string, sqlschema.Table] + wantTables *ordered.Map[string, sqlschema.Table] wantFKs []sqlschema.ForeignKey }{ { name: "inspect default schema", schemaName: defaultSchema, // Tables come sorted alphabetically by schema and table. - wantTables: orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( + wantTables: ordered.NewMap[string, sqlschema.Table]( // admin.offices should not be fetched, because it doesn't belong to the default schema. - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "articles", Value: &sqlschema.BaseTable{ Schema: defaultSchema, Name: "articles", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "isbn", Value: &sqlschema.BaseColumn{ SQLType: "bigint", @@ -104,7 +104,7 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "editor", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, @@ -114,7 +114,7 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "john doe", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "title", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, @@ -124,7 +124,7 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "locale", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, @@ -135,7 +135,7 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "en-GB", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "page_count", Value: &sqlschema.BaseColumn{ SQLType: "smallint", @@ -145,7 +145,7 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "1", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "book_count", Value: &sqlschema.BaseColumn{ SQLType: "integer", @@ -155,57 +155,57 @@ func TestDatabaseInspector_Inspect(t *testing.T) { DefaultValue: "", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "author_id", Value: &sqlschema.BaseColumn{ SQLType: "bigint", }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("isbn")}, UniqueConstraints: []sqlschema.Unique{ {Columns: sqlschema.NewColumns("editor", "title")}, }, }, }, - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "authors", Value: &sqlschema.BaseTable{ Schema: defaultSchema, Name: "authors", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "author_id", Value: &sqlschema.BaseColumn{ SQLType: "bigint", IsIdentity: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "email", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("author_id")}, UniqueConstraints: []sqlschema.Unique{ {Columns: sqlschema.NewColumns("first_name", "last_name")}, @@ -213,48 +213,48 @@ func TestDatabaseInspector_Inspect(t *testing.T) { }, }, }, - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "publisher_to_journalists", Value: &sqlschema.BaseTable{ Schema: defaultSchema, Name: "publisher_to_journalists", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "author_id", Value: &sqlschema.BaseColumn{ SQLType: "bigint", }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("publisher_id", "author_id")}, }, }, - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "publishers", Value: &sqlschema.BaseTable{ Schema: defaultSchema, Name: "publishers", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, DefaultValue: "gen_random_uuid()", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "created_at", Value: &sqlschema.BaseColumn{ SQLType: "timestamp", @@ -262,14 +262,14 @@ func TestDatabaseInspector_Inspect(t *testing.T) { IsNullable: true, }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("publisher_id")}, UniqueConstraints: []sqlschema.Unique{ {Columns: sqlschema.NewColumns("publisher_id", "publisher_name")}, }, }, }, - )), + ), wantFKs: []sqlschema.ForeignKey{ { From: sqlschema.NewColumnReference("articles", "publisher_id"), @@ -292,38 +292,38 @@ func TestDatabaseInspector_Inspect(t *testing.T) { { name: "inspect admin schema", schemaName: "admin", - wantTables: orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables: ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "offices", Value: &sqlschema.BaseTable{ Schema: "admin", Name: "offices", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "office_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "publisher_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("office_name")}, }, }, - )), + ), wantFKs: []sqlschema.ForeignKey{ { From: sqlschema.NewColumnReference("offices", "publisher_name", "publisher_id"), @@ -396,15 +396,16 @@ func mustCreateSchema(tb testing.TB, ctx context.Context, db *bun.DB, schema str func cmpTables( tb testing.TB, d sqlschema.InspectorDialect, - want, got *orderedmap.OrderedMap[string, sqlschema.Table], + want, got *ordered.Map[string, sqlschema.Table], ) { tb.Helper() require.ElementsMatch(tb, tableNames(want), tableNames(got), "different set of tables") // Now we are guaranteed to have the same tables. - for tableName, wantTable := range want.FromOldest() { - gotTable, ok := got.Get(tableName) + for _, tPair := range want.Pairs() { + tableName, wantTable := tPair.Key, tPair.Value + gotTable, ok := got.Load(tableName) require.True(tb, ok) cmpColumns(tb, d, wantTable.GetName(), wantTable.GetColumns(), gotTable.GetColumns()) cmpConstraints(tb, wantTable.(*sqlschema.BaseTable), gotTable.(*sqlschema.BaseTable)) @@ -416,17 +417,18 @@ func cmpColumns( tb testing.TB, d sqlschema.InspectorDialect, tableName string, - want, got *orderedmap.OrderedMap[string, sqlschema.Column], + want, got *ordered.Map[string, sqlschema.Column], ) { tb.Helper() var errs []string var missing []string - for colName, wantCol := range want.FromOldest() { + for _, cPair := range want.Pairs() { + colName := cPair.Key errorf := func(format string, args ...interface{}) { errs = append(errs, fmt.Sprintf("[%s.%s] "+format, append([]interface{}{tableName, colName}, args...)...)) } - wantCol := wantCol.(*sqlschema.BaseColumn) + wantCol := cPair.Value.(*sqlschema.BaseColumn) gotCol, ok := got.Value(colName).(*sqlschema.BaseColumn) if !ok { missing = append(missing, colName) @@ -459,8 +461,8 @@ func cmpColumns( } var extra []string - for colName := range got.FromOldest() { - if _, ok := want.Get(colName); !ok { + for _, colName := range got.Keys() { + if _, ok := want.Load(colName); !ok { extra = append(extra, colName) } } @@ -495,11 +497,8 @@ func cmpConstraints(tb testing.TB, want, got *sqlschema.BaseTable) { require.ElementsMatch(tb, stripNames(want.UniqueConstraints), stripNames(got.UniqueConstraints), "table %q does not have expected unique constraints (listA=want, listB=got)", want.Name) } -func tableNames(tables *orderedmap.OrderedMap[string, sqlschema.Table]) (names []string) { - for name := range tables.FromOldest() { - names = append(names, name) - } - return +func tableNames(tables *ordered.Map[string, sqlschema.Table]) []string { + return tables.Keys() } func formatType(c sqlschema.Column) string { @@ -525,29 +524,29 @@ func TestBunModelInspector_Inspect(t *testing.T) { tables.Register((*Model)(nil)) inspector := sqlschema.NewBunModelInspector(tables, sqlschema.WithSchemaName(dialect.DefaultSchema())) - want := orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + want := ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, DefaultValue: "random()", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, DefaultValue: "John Doe", }, }, - )) + ) got, err := inspector.Inspect(context.Background()) require.NoError(t, err) gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { cmpColumns(t, dialect.(sqlschema.InspectorDialect), "model", want, table.GetColumns()) return } @@ -564,35 +563,35 @@ func TestBunModelInspector_Inspect(t *testing.T) { tables.Register((*Model)(nil)) inspector := sqlschema.NewBunModelInspector(tables, sqlschema.WithSchemaName(dialect.DefaultSchema())) - want := orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + want := ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "id", Value: &sqlschema.BaseColumn{ SQLType: "text", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: "character varying", VarcharLen: 60, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: "varchar", VarcharLen: 100, }, }, - )) + ) got, err := inspector.Inspect(context.Background()) require.NoError(t, err) gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { cmpColumns(t, dialect.(sqlschema.InspectorDialect), "model", want, table.GetColumns()) } }) @@ -621,7 +620,7 @@ func TestBunModelInspector_Inspect(t *testing.T) { gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { cmpConstraints(t, want, &table.(*sqlschema.BunTable).BaseTable) return } @@ -643,7 +642,7 @@ func TestBunModelInspector_Inspect(t *testing.T) { gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { pk := table.GetPrimaryKey() require.NotNilf(t, pk, "did not register primary key, want (%s)", want) require.Equal(t, want, pk.Columns, "wrong primary key columns") @@ -665,7 +664,7 @@ func TestBunModelInspector_Inspect(t *testing.T) { gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { require.Equal(t, "custom_schema", table.GetSchema(), "wrong schema name") require.Equal(t, "model", table.GetName(), "wrong table name") return @@ -690,7 +689,7 @@ func TestBunModelInspector_Inspect(t *testing.T) { gotTables := got.GetTables() require.Equal(t, 1, gotTables.Len()) - for _, table := range gotTables.FromOldest() { + for _, table := range gotTables.Values() { require.Equal(t, "want", table.GetSchema(), "wrong schema name") require.Equal(t, "keep_me", table.GetName(), "wrong table name") return diff --git a/internal/dbtest/migrate_test.go b/internal/dbtest/migrate_test.go index 39b5ec787..6f06910af 100644 --- a/internal/dbtest/migrate_test.go +++ b/internal/dbtest/migrate_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/require" "github.com/uptrace/bun" "github.com/uptrace/bun/dialect/sqltype" + "github.com/uptrace/bun/internal/ordered" "github.com/uptrace/bun/migrate" "github.com/uptrace/bun/migrate/sqlschema" - orderedmap "github.com/wk8/go-ordered-map/v2" ) const ( @@ -381,7 +381,7 @@ func testRenameTable(t *testing.T, db *bun.DB) { state := inspect(ctx) tables := state.Tables require.Equal(t, 1, tables.Len()) - _, found := tables.Get("changed") + _, found := tables.Load("changed") require.True(t, found) } @@ -411,7 +411,7 @@ func testCreateDropTable(t *testing.T, db *bun.DB) { state := inspect(ctx) tables := state.Tables require.Equal(t, 1, tables.Len()) - _, found := tables.Get("createme") + _, found := tables.Load("createme") require.True(t, found) } @@ -538,7 +538,7 @@ func testRenamedColumns(t *testing.T, db *bun.DB) { require.Equal(t, 2, state.Tables.Len()) var renamed, model2 sqlschema.Table - for _, tbl := range state.Tables.FromOldest() { + for _, tbl := range state.Tables.Values() { switch tbl.GetName() { case "renamed": renamed = tbl @@ -579,21 +579,21 @@ func testChangeColumnType_AutoCast(t *testing.T, db *bun.DB) { // ManyValues []string `bun:",array"` // did not change } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "change_me_own_type", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "change_me_own_type", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "bigger_int", Value: &sqlschema.BaseColumn{ SQLType: "bigint", IsIdentity: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "ts", Value: &sqlschema.BaseColumn{ SQLType: "timestamp", // FIXME(dyma): convert "timestamp with time zone" to sqltype.Timestamp @@ -601,7 +601,7 @@ func testChangeColumnType_AutoCast(t *testing.T, db *bun.DB) { IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "default_expr", Value: &sqlschema.BaseColumn{ SQLType: "varchar", @@ -609,7 +609,7 @@ func testChangeColumnType_AutoCast(t *testing.T, db *bun.DB) { DefaultValue: "random()", }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "empty_default", Value: &sqlschema.BaseColumn{ SQLType: "varchar", @@ -617,14 +617,14 @@ func testChangeColumnType_AutoCast(t *testing.T, db *bun.DB) { DefaultValue: "", // NOT "''" }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "not_null", Value: &sqlschema.BaseColumn{ SQLType: "varchar", IsNullable: false, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "type_override", Value: &sqlschema.BaseColumn{ SQLType: "varchar", @@ -632,17 +632,17 @@ func testChangeColumnType_AutoCast(t *testing.T, db *bun.DB) { VarcharLen: 200, }, }, - // orderedmap.Pair[string, sqlschema.Column]{ + // ordered.Pair[string, sqlschema.Column]{ // Key: "many_values", // Value: &sqlschema.BaseColumn{ // SQLType: "array", // }, // }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("bigger_int")}, }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db) @@ -670,31 +670,31 @@ func testIdentity(t *testing.T, db *bun.DB) { B int64 `bun:",notnull,identity"` } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "bourne_identity", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "bourne_identity", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "a", Value: &sqlschema.BaseColumn{ SQLType: sqltype.BigInt, IsIdentity: false, // <- drop IDENTITY }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "b", Value: &sqlschema.BaseColumn{ SQLType: sqltype.BigInt, IsIdentity: true, // <- add IDENTITY }, }, - )), + ), }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db) @@ -722,31 +722,31 @@ func testAddDropColumn(t *testing.T, db *bun.DB) { AddMe bool `bun:"addme"` } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "column_madness", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "column_madness", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "do_not_touch", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "addme", Value: &sqlschema.BaseColumn{ SQLType: sqltype.Boolean, IsNullable: true, }, }, - )), + ), }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db) @@ -784,63 +784,63 @@ func testUnique(t *testing.T, db *bun.DB) { PetBreed string `bun:"pet_breed"` // shrink "pet" unique group } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "uniqlo_stores", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "uniqlo_stores", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "middle_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "birthday", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "email", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "pet_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "pet_breed", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - )), + ), UniqueConstraints: []sqlschema.Unique{ {Columns: sqlschema.NewColumns("email")}, {Columns: sqlschema.NewColumns("pet_name")}, @@ -849,7 +849,7 @@ func testUnique(t *testing.T, db *bun.DB) { }, }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db) @@ -886,49 +886,49 @@ func testUniqueRenamedTable(t *testing.T, db *bun.DB) { PetBreed string `bun:"pet_breed,unique"` } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "after", Value: &sqlschema.BaseTable{ Schema: "automigrate", Name: "after", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "birthday", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "pet_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "pet_breed", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - )), + ), UniqueConstraints: []sqlschema.Unique{ {Columns: sqlschema.NewColumns("pet_name")}, {Columns: sqlschema.NewColumns("pet_breed")}, @@ -936,7 +936,7 @@ func testUniqueRenamedTable(t *testing.T, db *bun.DB) { }, }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db, "automigrate") @@ -1003,37 +1003,37 @@ func testUpdatePrimaryKeys(t *testing.T, db *bun.DB) { LastName string `bun:"last_name,pk"` } - wantTables := orderedmap.New[string, sqlschema.Table](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Table]{ + wantTables := ordered.NewMap[string, sqlschema.Table]( + ordered.Pair[string, sqlschema.Table]{ Key: "drop_your_pks", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "drop_your_pks", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: false, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: false, }, }, - )), + ), }, }, - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "add_new_pk", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "add_new_pk", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "new_id", Value: &sqlschema.BaseColumn{ SQLType: sqltype.BigInt, @@ -1041,49 +1041,49 @@ func testUpdatePrimaryKeys(t *testing.T, db *bun.DB) { IsIdentity: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: true, }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("new_id")}, }, }, - orderedmap.Pair[string, sqlschema.Table]{ + ordered.Pair[string, sqlschema.Table]{ Key: "change_pk", Value: &sqlschema.BaseTable{ Schema: db.Dialect().DefaultSchema(), Name: "change_pk", - Columns: orderedmap.New[string, sqlschema.Column](orderedmap.WithInitialData( - orderedmap.Pair[string, sqlschema.Column]{ + Columns: ordered.NewMap[string, sqlschema.Column]( + ordered.Pair[string, sqlschema.Column]{ Key: "first_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: false, }, }, - orderedmap.Pair[string, sqlschema.Column]{ + ordered.Pair[string, sqlschema.Column]{ Key: "last_name", Value: &sqlschema.BaseColumn{ SQLType: sqltype.VarChar, IsNullable: false, }, }, - )), + ), PrimaryKey: &sqlschema.PrimaryKey{Columns: sqlschema.NewColumns("first_name", "last_name")}, }, }, - )) + ) ctx := context.Background() inspect := inspectDbOrSkip(t, db) diff --git a/internal/ordered/map.go b/internal/ordered/map.go new file mode 100644 index 000000000..d5e4f7d9d --- /dev/null +++ b/internal/ordered/map.go @@ -0,0 +1,125 @@ +package ordered + +// Pair represents a key-value pair in the ordered map. +type Pair[K comparable, V any] struct { + Key K + Value V + + next, prev *Pair[K, V] // Pointers to the next and previous pairs in the linked list. +} + +// Map represents an ordered map. +type Map[K comparable, V any] struct { + root *Pair[K, V] // Sentinel node for the circular doubly linked list. + zero V // Zero value for the value type. + + pairs map[K]*Pair[K, V] // Map from keys to pairs. +} + +// NewMap creates a new ordered map with optional initial data. +func NewMap[K comparable, V any](initialData ...Pair[K, V]) *Map[K, V] { + m := &Map[K, V]{} + m.Clear() + for _, pair := range initialData { + m.Store(pair.Key, pair.Value) + } + return m +} + +// Clear removes all pairs from the map. +func (m *Map[K, V]) Clear() { + if m.root != nil { + m.root.next, m.root.prev = nil, nil // avoid memory leaks + } + for _, pair := range m.pairs { + pair.next, pair.prev = nil, nil // avoid memory leaks + } + m.root = &Pair[K, V]{} + m.root.next, m.root.prev = m.root, m.root + m.pairs = make(map[K]*Pair[K, V]) +} + +// Len returns the number of pairs in the map. +func (m *Map[K, V]) Len() int { + return len(m.pairs) +} + +// Load returns the value associated with the key, and a boolean indicating if the key was found. +func (m *Map[K, V]) Load(key K) (V, bool) { + if pair, present := m.pairs[key]; present { + return pair.Value, true + } + return m.zero, false +} + +// Value returns the value associated with the key, or the zero value if the key is not found. +func (m *Map[K, V]) Value(key K) V { + if pair, present := m.pairs[key]; present { + return pair.Value + } + return m.zero +} + +// Store adds or updates a key-value pair in the map. +func (m *Map[K, V]) Store(key K, value V) { + if pair, present := m.pairs[key]; present { + pair.Value = value + return + } + + pair := &Pair[K, V]{Key: key, Value: value} + pair.prev = m.root.prev + m.root.prev.next = pair + m.root.prev = pair + pair.next = m.root + m.pairs[key] = pair +} + +// Delete removes a key-value pair from the map. +func (m *Map[K, V]) Delete(key K) { + if pair, present := m.pairs[key]; present { + pair.prev.next = pair.next + pair.next.prev = pair.prev + pair.next, pair.prev = nil, nil // avoid memory leaks + delete(m.pairs, key) + } +} + +// Range calls the given function for each key-value pair in the map in order. +func (m *Map[K, V]) Range(yield func(key K, value V) bool) { + for pair := m.root.next; pair != m.root; pair = pair.next { + if !yield(pair.Key, pair.Value) { + break + } + } +} + +// Keys returns a slice of all keys in the map in order. +func (m *Map[K, V]) Keys() []K { + keys := make([]K, 0, len(m.pairs)) + m.Range(func(key K, _ V) bool { + keys = append(keys, key) + return true + }) + return keys +} + +// Values returns a slice of all values in the map in order. +func (m *Map[K, V]) Values() []V { + values := make([]V, 0, len(m.pairs)) + m.Range(func(_ K, value V) bool { + values = append(values, value) + return true + }) + return values +} + +// Pairs returns a slice of all key-value pairs in the map in order. +func (m *Map[K, V]) Pairs() []Pair[K, V] { + pairs := make([]Pair[K, V], 0, len(m.pairs)) + m.Range(func(key K, value V) bool { + pairs = append(pairs, Pair[K, V]{Key: key, Value: value}) + return true + }) + return pairs +} diff --git a/internal/ordered/map_test.go b/internal/ordered/map_test.go new file mode 100644 index 000000000..22ad4b619 --- /dev/null +++ b/internal/ordered/map_test.go @@ -0,0 +1,74 @@ +package ordered_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/uptrace/bun/internal/ordered" +) + +func TestBasicFeatures(t *testing.T) { + m := ordered.NewMap[int, int]() + + // Test initialization + assert.Equal(t, 0, m.Len(), "expected length 0") + + // Test storing and loading + m.Store(5, 50) + m.Store(3, 30) + m.Store(1, 10) + m.Store(4, 40) + m.Store(2, 20) + + assert.Equal(t, 5, m.Len(), "expected length 5 after storing 5 elements") + + val, ok := m.Load(1) + assert.True(t, ok, "expected key 1 to be present") + assert.Equal(t, 10, val, "expected value 10 for key 1") + + val, ok = m.Load(2) + assert.True(t, ok, "expected key 2 to be present") + assert.Equal(t, 20, val, "expected value 20 for key 2") + + val, ok = m.Load(3) + assert.True(t, ok, "expected key 3 to be present") + assert.Equal(t, 30, val, "expected value 30 for key 3") + + val, ok = m.Load(4) + assert.True(t, ok, "expected key 4 to be present") + assert.Equal(t, 40, val, "expected value 40 for key 4") + + val, ok = m.Load(5) + assert.True(t, ok, "expected key 5 to be present") + assert.Equal(t, 50, val, "expected value 50 for key 5") + + // Test ordering + expectedKeys := []int{5, 3, 1, 4, 2} + assert.Equal(t, expectedKeys, m.Keys(), "expected keys to be [5, 3, 1, 4, 2]") + + expectedValues := []int{50, 30, 10, 40, 20} + assert.Equal(t, expectedValues, m.Values(), "expected values to be [50, 30, 10, 40, 20]") + + // Test deletion + m.Delete(3) + assert.Equal(t, 4, m.Len(), "expected length 4 after deleting key 3") + expectedKeys = []int{5, 1, 4, 2} + assert.Equal(t, expectedKeys, m.Keys(), "expected keys to be [5, 1, 4, 2]") + + expectedValues = []int{50, 10, 40, 20} + assert.Equal(t, expectedValues, m.Values(), "expected values to be [50, 10, 40, 20]") + + m.Delete(1) + assert.Equal(t, 3, m.Len(), "expected length 3 after deleting key 1") + expectedKeys = []int{5, 4, 2} + assert.Equal(t, expectedKeys, m.Keys(), "expected keys to be [5, 4, 2]") + + expectedValues = []int{50, 40, 20} + assert.Equal(t, expectedValues, m.Values(), "expected values to be [50, 40, 20]") + + // Test clearing the map + m.Clear() + assert.Equal(t, 0, m.Len(), "expected length 0 after clearing the map") + assert.Empty(t, m.Keys(), "expected no keys after clearing the map") + assert.Empty(t, m.Values(), "expected no values after clearing the map") +} diff --git a/migrate/diff.go b/migrate/diff.go index 42e55dcde..e05d54b7d 100644 --- a/migrate/diff.go +++ b/migrate/diff.go @@ -26,20 +26,21 @@ func (d *detector) detectChanges() *changeset { targetTables := d.target.GetTables() RenameCreate: - for wantName, wantTable := range targetTables.FromOldest() { - + for _, wantPair := range targetTables.Pairs() { + wantName, wantTable := wantPair.Key, wantPair.Value // A table with this name exists in the database. We assume that schema objects won't // be renamed to an already existing name, nor do we support such cases. // Simply check if the table definition has changed. - if haveTable, ok := currentTables.Get(wantName); ok { + if haveTable, ok := currentTables.Load(wantName); ok { d.detectColumnChanges(haveTable, wantTable, true) d.detectConstraintChanges(haveTable, wantTable) continue } // Find all renamed tables. We assume that renamed tables have the same signature. - for haveName, haveTable := range currentTables.FromOldest() { - if _, exists := targetTables.Get(haveName); !exists && d.canRename(haveTable, wantTable) { + for _, havePair := range currentTables.Pairs() { + haveName, haveTable := havePair.Key, havePair.Value + if _, exists := targetTables.Load(haveName); !exists && d.canRename(haveTable, wantTable) { d.changes.Add(&RenameTableOp{ TableName: haveTable.GetName(), NewName: wantName, @@ -65,8 +66,9 @@ RenameCreate: } // Drop any remaining "current" tables which do not have a model. - for name, table := range currentTables.FromOldest() { - if _, keep := targetTables.Get(name); !keep { + for _, tPair := range currentTables.Pairs() { + name, table := tPair.Key, tPair.Value + if _, keep := targetTables.Load(name); !keep { d.changes.Add(&DropTableOp{ TableName: table.GetName(), }) @@ -103,12 +105,13 @@ func (d *detector) detectColumnChanges(current, target sqlschema.Table, checkTyp targetColumns := target.GetColumns() ChangeRename: - for tName, tCol := range targetColumns.FromOldest() { + for _, tPair := range targetColumns.Pairs() { + tName, tCol := tPair.Key, tPair.Value // This column exists in the database, so it hasn't been renamed, dropped, or added. // Still, we should not delete(columns, thisColumn), because later we will need to // check that we do not try to rename a column to an already a name that already exists. - if cCol, ok := currentColumns.Get(tName); ok { + if cCol, ok := currentColumns.Load(tName); ok { if checkType && !d.equalColumns(cCol, tCol) { d.changes.Add(&ChangeColumnTypeOp{ TableName: target.GetName(), @@ -122,9 +125,10 @@ ChangeRename: // Column tName does not exist in the database -- it's been either renamed or added. // Find renamed columns first. - for cName, cCol := range currentColumns.FromOldest() { + for _, cPair := range currentColumns.Pairs() { + cName, cCol := cPair.Key, cPair.Value // Cannot rename if a column with this name already exists or the types differ. - if _, exists := targetColumns.Get(cName); exists || !d.equalColumns(tCol, cCol) { + if _, exists := targetColumns.Load(cName); exists || !d.equalColumns(tCol, cCol) { continue } d.changes.Add(&RenameColumnOp{ @@ -149,8 +153,9 @@ ChangeRename: } // Drop columns which do not exist in the target schema and were not renamed. - for cName, cCol := range currentColumns.FromOldest() { - if _, keep := targetColumns.Get(cName); !keep { + for _, cPair := range currentColumns.Pairs() { + cName, cCol := cPair.Key, cPair.Value + if _, keep := targetColumns.Load(cName); !keep { d.changes.Add(&DropColumnOp{ TableName: target.GetName(), ColumnName: cName, @@ -325,7 +330,7 @@ func newSignature(t sqlschema.Table, eq CompareTypeFunc) signature { // scan iterates over table's field and counts occurrences of each unique column definition. func (s *signature) scan(t sqlschema.Table) { - for _, icol := range t.GetColumns().FromOldest() { + for _, icol := range t.GetColumns().Values() { scanCol := icol.(*sqlschema.BaseColumn) // This is slightly more expensive than if the columns could be compared directly // and we always did s.underlying[col]++, but we get type-equivalence in return. diff --git a/migrate/sqlschema/database.go b/migrate/sqlschema/database.go index cdc5b2d50..eb7476c54 100644 --- a/migrate/sqlschema/database.go +++ b/migrate/sqlschema/database.go @@ -4,12 +4,12 @@ import ( "slices" "strings" + "github.com/uptrace/bun/internal/ordered" "github.com/uptrace/bun/schema" - orderedmap "github.com/wk8/go-ordered-map/v2" ) type Database interface { - GetTables() *orderedmap.OrderedMap[string, Table] + GetTables() *ordered.Map[string, Table] GetForeignKeys() map[ForeignKey]string } @@ -20,11 +20,11 @@ var _ Database = (*BaseDatabase)(nil) // Dialects and only dialects can use it to implement the Database interface. // Other packages must use the Database interface. type BaseDatabase struct { - Tables *orderedmap.OrderedMap[string, Table] + Tables *ordered.Map[string, Table] ForeignKeys map[ForeignKey]string } -func (ds BaseDatabase) GetTables() *orderedmap.OrderedMap[string, Table] { +func (ds BaseDatabase) GetTables() *ordered.Map[string, Table] { return ds.Tables } diff --git a/migrate/sqlschema/inspector.go b/migrate/sqlschema/inspector.go index 43fc66447..19d1dc469 100644 --- a/migrate/sqlschema/inspector.go +++ b/migrate/sqlschema/inspector.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/uptrace/bun" + "github.com/uptrace/bun/internal/ordered" "github.com/uptrace/bun/schema" - orderedmap "github.com/wk8/go-ordered-map/v2" ) type InspectorDialect interface { @@ -102,21 +102,21 @@ func (bmi *BunModelInspector) Inspect(ctx context.Context) (Database, error) { BaseDatabase: BaseDatabase{ ForeignKeys: make(map[ForeignKey]string), }, - Tables: orderedmap.New[string, Table](), + Tables: ordered.NewMap[string, Table](), } for _, t := range bmi.tables.All() { if t.Schema != bmi.SchemaName { continue } - columns := orderedmap.New[string, Column]() + columns := ordered.NewMap[string, Column]() for _, f := range t.Fields { sqlType, length, err := parseLen(f.CreateTableSQLType) if err != nil { return nil, fmt.Errorf("parse length in %q: %w", f.CreateTableSQLType, err) } - columns.Set(f.Name, &BaseColumn{ + columns.Store(f.Name, &BaseColumn{ Name: f.Name, SQLType: strings.ToLower(sqlType), // TODO(dyma): maybe this is not necessary after Column.Eq() VarcharLen: length, @@ -162,7 +162,7 @@ func (bmi *BunModelInspector) Inspect(ctx context.Context) (Database, error) { // produces // schema.Table{ Schema: "favourite", Name: "favourite.books" } tableName := strings.TrimPrefix(t.Name, t.Schema+".") - state.Tables.Set(tableName, &BunTable{ + state.Tables.Store(tableName, &BunTable{ BaseTable: BaseTable{ Schema: t.Schema, Name: tableName, @@ -226,10 +226,10 @@ func exprOrLiteral(s string) string { type BunModelSchema struct { BaseDatabase - Tables *orderedmap.OrderedMap[string, Table] + Tables *ordered.Map[string, Table] } -func (ms BunModelSchema) GetTables() *orderedmap.OrderedMap[string, Table] { +func (ms BunModelSchema) GetTables() *ordered.Map[string, Table] { return ms.Tables } diff --git a/migrate/sqlschema/table.go b/migrate/sqlschema/table.go index a805ba780..ec9b77f69 100644 --- a/migrate/sqlschema/table.go +++ b/migrate/sqlschema/table.go @@ -1,13 +1,13 @@ package sqlschema import ( - orderedmap "github.com/wk8/go-ordered-map/v2" + "github.com/uptrace/bun/internal/ordered" ) type Table interface { GetSchema() string GetName() string - GetColumns() *orderedmap.OrderedMap[string, Column] + GetColumns() *ordered.Map[string, Column] GetPrimaryKey() *PrimaryKey GetUniqueConstraints() []Unique } @@ -23,7 +23,7 @@ type BaseTable struct { Name string // ColumnDefinitions map each column name to the column definition. - Columns *orderedmap.OrderedMap[string, Column] + Columns *ordered.Map[string, Column] // PrimaryKey holds the primary key definition. // A nil value means that no primary key is defined for the table. @@ -47,7 +47,7 @@ func (td *BaseTable) GetName() string { return td.Name } -func (td *BaseTable) GetColumns() *orderedmap.OrderedMap[string, Column] { +func (td *BaseTable) GetColumns() *ordered.Map[string, Column] { return td.Columns }