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: Implement Sort, Sort ReadOnly and Sort Store commands #2888

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

niharikabhavaraju
Copy link
Contributor

Implementing the Sort, Sort ReadOnly and Sort Store commands in GO client.

Signed-off-by: Niharika Bhavaraju <[email protected]>
Signed-off-by: Niharika Bhavaraju <[email protected]>
@@ -279,6 +280,128 @@ func (listDirection ListDirection) toString() (string, error) {
}
}

const (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these changes into a separate file under package options.

@@ -225,3 +225,254 @@ func (suite *GlideTestSuite) TestConfigSetAndGet_invalidArgs() {
assert.Equal(suite.T(), map[api.Result[string]]api.Result[string]{}, result2)
assert.Nil(suite.T(), err)
}

func (suite *GlideTestSuite) TestSortWithOptions_ExternalWeights() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this functionality specific to standalone or a particular version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some SORT options (searching in multiple keys) available only in standalone mode.
It was planned to support this on server side in cluster mode with condition that all keys are mapped to the same slot. I don't know the status of this feature - could you check please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the valkey documentation, this is specific to a particular version 8.0.0 https://valkey.io/commands/sort/. I modified the tests accordingly.

@Yury-Fridlyand Yury-Fridlyand added the go golang wrapper label Jan 2, 2025
@@ -225,3 +225,254 @@ func (suite *GlideTestSuite) TestConfigSetAndGet_invalidArgs() {
assert.Equal(suite.T(), map[api.Result[string]]api.Result[string]{}, result2)
assert.Nil(suite.T(), err)
}

func (suite *GlideTestSuite) TestSortWithOptions_ExternalWeights() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some SORT options (searching in multiple keys) available only in standalone mode.
It was planned to support this on server side in cluster mode with condition that all keys are mapped to the same slot. I don't know the status of this feature - could you check please?

go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/command_options.go Outdated Show resolved Hide resolved
go/api/command_options.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/options/sort_options.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/generic_commands.go Outdated Show resolved Hide resolved
go/api/options/sort_options.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go golang wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants