Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-redis/v9 compatibility #75

Open
pulpfree opened this issue May 16, 2023 · 5 comments
Open

go-redis/v9 compatibility #75

pulpfree opened this issue May 16, 2023 · 5 comments

Comments

@pulpfree
Copy link

I noticed you used go-redis/v9 in your examples and hoped to do the same.
When calling: jsonh.SetGoRedisClientWithContext(context.Background(), client)

I get the following error:
cannot use client (variable of type *"github.com/redis/go-redis/v9".Client) as clients.GoRedisClientConn value in argument to jsonh.SetGoRedisClientWithContext: *"github.com/redis/go-redis/v9".Client does not implement clients.GoRedisClientConn (wrong type for method Do). have Do(context.Context, ...interface{}) *"github.com/redis/go-redis/v9".Cmd. want Do(context.Context, ...interface{}) *"github.com/go-redis/redis/v8".Cmd

Also, in my go.mod file after running go mod tidy
I got the v8 installed as an indirect dependency

Here's my Redis Client setup:

jsonh := rejson.NewReJSONHandler()

rdb.setConnectUri()
opt, err := redis.ParseURL(rdb.connectUri)

client := redis.NewClient(opt)
jsonh.SetGoRedisClientWithContext(context.Background(), client)

So curious as to why this works in your examples, but I'm unable to do the same.

Thanks,
Ron

@Shivam010
Copy link
Collaborator

Curious 🤔

Can you provide a small program with go modules that replicates the error? I feel like it's related to the versions you're using.

@pulpfree
Copy link
Author

pulpfree commented May 16, 2023

Sure view test repo

This repo is based on the subgraph-go-gqlgen template for building gqlgen graphs

@unitoftime
Copy link

Hi I had this same problem and was able to resolve it. Looks like it is caused because there is no new tag after the v9 upgrade was done. When users run go get github.com/nitishm/go-rejson/v4 they'll get the latest tag build (v4.1.0), which is like a year old. Users can workaround this by running: go get github.com/nitishm/go-rejson/v4@master to get the latest commit on the master branch. Or someone can add a new tag, then people can just pull from that.

@DEMON1A
Copy link

DEMON1A commented Jun 13, 2023

@unitoftime Thanks bud, was on my way to downgrade to go-redis v8 but your solution did work for me

@vpereira
Copy link

@Shivam010 could you please release a new tag, to include the PR #72 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants