Skip to content

Commit 0b58af2

Browse files
authored
Upgrade pipe-fittings to v2; go-kit to v1 (#540)
1 parent 060e706 commit 0b58af2

File tree

8 files changed

+43
-47
lines changed

8 files changed

+43
-47
lines changed

go.mod

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
module github.com/turbot/steampipe-postgres-fdw
22

3-
go 1.22.4
3+
go 1.23.1
4+
5+
toolchain go1.23.3
46

57
require (
6-
github.com/dgraph-io/ristretto v0.1.1 // indirect
8+
github.com/dgraph-io/ristretto v0.2.0 // indirect
79
github.com/golang/protobuf v1.5.4
810
github.com/hashicorp/go-hclog v1.6.3
911
github.com/hashicorp/go-version v1.7.0 // indirect
10-
github.com/turbot/go-kit v0.10.0-rc.0
11-
github.com/turbot/steampipe v1.0.2
12-
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2
12+
github.com/turbot/go-kit v1.0.0
13+
github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731
14+
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3
1315
go.opentelemetry.io/otel v1.26.0
1416
google.golang.org/protobuf v1.34.2
1517
)
1618

1719
require (
1820
github.com/Masterminds/semver/v3 v3.2.1
19-
github.com/turbot/pipe-fittings v1.6.8
21+
github.com/turbot/pipe-fittings/v2 v2.1.1
2022
go.opentelemetry.io/otel/metric v1.26.0
2123
)
2224

@@ -77,15 +79,14 @@ require (
7779
github.com/leodido/go-urn v1.4.0 // indirect
7880
github.com/moby/locker v1.0.1 // indirect
7981
github.com/pjbgf/sha1cd v0.3.0 // indirect
80-
github.com/robfig/cron/v3 v3.0.1 // indirect
8182
github.com/rs/xid v1.5.0 // indirect
8283
github.com/sagikazarmark/locafero v0.4.0 // indirect
8384
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
8485
github.com/sourcegraph/conc v0.3.0 // indirect
8586
github.com/spf13/cobra v1.8.1 // indirect
8687
github.com/thediveo/enumflag/v2 v2.0.5 // indirect
8788
github.com/turbot/pipes-sdk-go v0.12.0 // indirect
88-
github.com/turbot/steampipe-plugin-code v0.7.0 // indirect
89+
github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1 // indirect
8990
github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 // indirect
9091
github.com/ulikunitz/xz v0.5.10 // indirect
9192
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
@@ -118,15 +119,14 @@ require (
118119
github.com/cespare/xxhash/v2 v2.3.0 // indirect
119120
github.com/containerd/containerd v1.7.23 // indirect
120121
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
121-
github.com/dustin/go-humanize v1.0.0 // indirect
122+
github.com/dustin/go-humanize v1.0.1 // indirect
122123
github.com/fatih/color v1.17.0 // indirect
123124
github.com/fsnotify/fsnotify v1.7.0 // indirect
124125
github.com/gertd/go-pluralize v0.2.1
125126
github.com/ghodss/yaml v1.0.0 // indirect
126127
github.com/go-logr/logr v1.4.1 // indirect
127128
github.com/go-logr/stdr v1.2.2 // indirect
128129
github.com/go-ole/go-ole v1.2.6 // indirect
129-
github.com/golang/glog v1.2.4 // indirect
130130
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
131131
github.com/google/go-cmp v0.6.0 // indirect
132132
github.com/google/uuid v1.6.0 // indirect

go.sum

+16-21
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
300300
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
301301
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
302302
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
303-
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
304-
github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
305-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
306-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
307-
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
308-
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
303+
github.com/dgraph-io/ristretto v0.2.0 h1:XAfl+7cmoUDWW/2Lx8TGZQjjxIQ2Ley9DSf52dru4WE=
304+
github.com/dgraph-io/ristretto v0.2.0/go.mod h1:8uBHCU/PBV4Ag0CJrP47b9Ofby5dqWNh4FicAdoqFNU=
305+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
306+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
307+
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
308+
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
309309
github.com/eko/gocache/lib/v4 v4.1.6 h1:5WWIGISKhE7mfkyF+SJyWwqa4Dp2mkdX8QsZpnENqJI=
310310
github.com/eko/gocache/lib/v4 v4.1.6/go.mod h1:HFxC8IiG2WeRotg09xEnPD72sCheJiTSr4Li5Ameg7g=
311311
github.com/eko/gocache/store/bigcache/v4 v4.2.1 h1:xf9R5HZqmrfT4+NzlJPQJQUWftfWW06FHbjz4IEjE08=
@@ -385,8 +385,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
385385
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
386386
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
387387
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
388-
github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc=
389-
github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
390388
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
391389
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
392390
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -683,8 +681,6 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5
683681
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
684682
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
685683
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
686-
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
687-
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
688684
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
689685
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
690686
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
@@ -753,18 +749,18 @@ github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2bi
753749
github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8=
754750
github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE=
755751
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
756-
github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKUlSoA=
757-
github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs=
758-
github.com/turbot/pipe-fittings v1.6.8 h1:cIzFQdHU081IyyWff9R3ieR9fzIxdB3kiSZxwl1K6oc=
759-
github.com/turbot/pipe-fittings v1.6.8/go.mod h1:CYlcJEGHs39ZSHJm1iHXtQSSaUApJZMQ5M7XeZj8pEc=
752+
github.com/turbot/go-kit v1.0.0 h1:TeVYepMyPMpiQ8GxmZcth9h1CzKRshWK+X9JGKAnXOo=
753+
github.com/turbot/go-kit v1.0.0/go.mod h1:vPk4gTUM8HhYGdzfKKLrPeZgnjLVBin41uqxjHScz6k=
754+
github.com/turbot/pipe-fittings/v2 v2.1.1 h1:sV6bviX7WH3zivi45n29+ui+I9tJLlFNCNA2rOpw6/U=
755+
github.com/turbot/pipe-fittings/v2 v2.1.1/go.mod h1:mGFH8dfDQOdv+d1fNL2r3ex+qlnVrTi3xGKZRVxoCEU=
760756
github.com/turbot/pipes-sdk-go v0.12.0 h1:esbbR7bALa5L8n/hqroMPaQSSo3gNM/4X0iTmHa3D6U=
761757
github.com/turbot/pipes-sdk-go v0.12.0/go.mod h1:Mb+KhvqqEdRbz/6TSZc2QWDrMa5BN3E4Xw+gPt2TRkc=
762-
github.com/turbot/steampipe v1.0.2 h1:DDOyobm4lk6GLWmfwNtjB47YEbkoDmGMOlXvmTWDVsU=
763-
github.com/turbot/steampipe v1.0.2/go.mod h1:MmQAJWZXBzGczTukxRaflQC93zpYaVvm8GZfpJsE7u4=
764-
github.com/turbot/steampipe-plugin-code v0.7.0 h1:SROYIo/TI/Q/YNfXK+sAIS71umypUFm1Uz851TmoJkM=
765-
github.com/turbot/steampipe-plugin-code v0.7.0/go.mod h1:GvdjncWum4sZNmR0iM03SKkIzl7aZKAFtIsyAR+z4YI=
766-
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2 h1:oOOM5lk1RGnXUKYYAhsxcK45TcTuKUeE+r8lA3UYJAQ=
767-
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.2/go.mod h1:JJVjTmepkwUSC7BgXyyYCvtmhuLXAEathl737Qs4Mls=
758+
github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731 h1:5nZMBweevlTHK1tAyqvuKuaBkhUvxatYtT2yNxAbAkk=
759+
github.com/turbot/steampipe v1.7.0-rc.0.0.20250210104953-c81e20d80731/go.mod h1:tGfEzPyhwuQEcJY2eQMO7k/TfAvFF2mTWzgP5L9B/u0=
760+
github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1 h1:mN0k0SGAN0pqPh92QZfJIzFzXuz6TiMALnLLLgCqnTI=
761+
github.com/turbot/steampipe-plugin-code v1.0.1-alpha.1/go.mod h1:Dhkl99FVa9eHbBbHgyy0Zf6jj7eVjZZujyqore+RHmQ=
762+
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3 h1:/b+ZUVydvkvjtNB0LbzVkDoWy/GB0qrucAxiUg4yznM=
763+
github.com/turbot/steampipe-plugin-sdk/v5 v5.11.3/go.mod h1:zI1JuJjVV+tiqK1MbOfEfeyHJzONRQh/NEYVXEOyd4o=
768764
github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7 h1:qDMxFVd8Zo0rIhnEBdCIbR+T6WgjwkxpFZMN8zZmmjg=
769765
github.com/turbot/terraform-components v0.0.0-20231213122222-1f3526cab7a7/go.mod h1:5hzpfalEjfcJWp9yq75/EZoEu2Mzm34eJAPm3HOW2tw=
770766
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
@@ -1045,7 +1041,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
10451041
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10461042
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10471043
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1048-
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10491044
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10501045
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
10511046
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=

hub/connection_factory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77
"sync"
88

9-
"github.com/turbot/pipe-fittings/utils"
9+
"github.com/turbot/pipe-fittings/v2/utils"
1010
"github.com/turbot/steampipe/pkg/pluginmanager"
1111

1212
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"

hub/hub_base.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ package hub
33
import (
44
"context"
55
"fmt"
6-
"github.com/turbot/go-kit/helpers"
6+
"log"
7+
"slices"
8+
"strings"
9+
"sync"
10+
711
"github.com/turbot/steampipe-plugin-sdk/v5/grpc"
812
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
913
"github.com/turbot/steampipe-plugin-sdk/v5/telemetry"
@@ -14,9 +18,6 @@ import (
1418
"go.opentelemetry.io/otel"
1519
"go.opentelemetry.io/otel/attribute"
1620
"go.opentelemetry.io/otel/metric"
17-
"log"
18-
"strings"
19-
"sync"
2021
)
2122

2223
type hubBase struct {
@@ -319,7 +320,7 @@ func (h *hubBase) GetSettingsSchema() map[string]*proto.TableSchema {
319320
func (h *hubBase) ValidateCacheCommand(command string) error {
320321
validCommands := []string{constants.LegacyCommandCacheClear, constants.LegacyCommandCacheOn, constants.LegacyCommandCacheOff}
321322

322-
if !helpers.StringSliceContains(validCommands, command) {
323+
if !slices.Contains(validCommands, command) {
323324
return fmt.Errorf("invalid command '%s' - supported commands are %s", command, strings.Join(validCommands, ","))
324325
}
325326
return nil
@@ -419,7 +420,7 @@ func (h *hubBase) shouldPushdownLimit(table string, qualMap map[string]*proto.Qu
419420
// check whether every qual for this column has a supported operator
420421
for _, q := range quals.Quals {
421422
operator := q.GetStringValue()
422-
if !helpers.StringSliceContains(k.Operators, operator) {
423+
if !slices.Contains(k.Operators, operator) {
423424
log.Printf("[INFO] operator '%s' not supported for column '%s'. NOT pushing down limit", operator, col)
424425
return false
425426
}

hub/hub_local.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"time"
77

88
typehelpers "github.com/turbot/go-kit/types"
9-
"github.com/turbot/pipe-fittings/ociinstaller"
9+
"github.com/turbot/pipe-fittings/v2/ociinstaller"
1010
"github.com/turbot/steampipe-plugin-sdk/v5/grpc"
1111
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
1212
"github.com/turbot/steampipe-plugin-sdk/v5/logging"

hub/hub_remote.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"time"
1111

1212
typehelpers "github.com/turbot/go-kit/types"
13-
"github.com/turbot/pipe-fittings/app_specific"
14-
"github.com/turbot/pipe-fittings/modconfig"
15-
"github.com/turbot/pipe-fittings/utils"
13+
"github.com/turbot/pipe-fittings/v2/app_specific"
14+
"github.com/turbot/pipe-fittings/v2/modconfig"
15+
"github.com/turbot/pipe-fittings/v2/utils"
1616
"github.com/turbot/steampipe-plugin-sdk/v5/grpc"
1717
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
1818
"github.com/turbot/steampipe-plugin-sdk/v5/logging"

schema.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import "C"
99

1010
import (
1111
"log"
12+
"slices"
1213
"unsafe"
1314

14-
"github.com/turbot/go-kit/helpers"
1515
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
1616
"github.com/turbot/steampipe-postgres-fdw/sql"
1717
)
@@ -44,15 +44,15 @@ func SchemaToSql(schema map[string]*proto.TableSchema, stmt *C.ImportForeignSche
4444
if stmt.list_type == C.FDW_IMPORT_SCHEMA_LIMIT_TO {
4545
log.Printf("[TRACE] list_type is FDW_IMPORT_SCHEMA_LIMIT_TO: %v", tables)
4646

47-
if !helpers.StringSliceContains(tables, table) {
47+
if !slices.Contains(tables, table) {
4848
log.Printf("[TRACE] Skipping table %s", table)
4949

5050
continue
5151
}
5252
} else if stmt.list_type == C.FDW_IMPORT_SCHEMA_EXCEPT {
5353
log.Printf("[TRACE] list_type is FDW_IMPORT_SCHEMA_EXCEPT: %v", tables)
5454

55-
if helpers.StringSliceContains(tables, table) {
55+
if slices.Contains(tables, table) {
5656
log.Printf("[TRACE] Skipping table %s", table)
5757
continue
5858
}

types/pathkeys.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package types
22

33
import (
44
"log"
5+
"slices"
56
"sort"
67
"strings"
78

8-
"github.com/turbot/go-kit/helpers"
99
"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
1010
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
1111
)
@@ -169,7 +169,7 @@ func columnPathsToPathKeys(columnPaths [][]string, allColumns []string, baseCost
169169
})
170170
// also create paths for the columns path WITH each other column
171171
for _, c := range allColumns {
172-
if !helpers.StringSliceContains(s, c) {
172+
if !slices.Contains(s, c) {
173173
// NOTE: create a new slice rather than appending onto s - to avoid clash between loop iterations
174174
columnNames := append([]string{c}, s...)
175175

0 commit comments

Comments
 (0)