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

admin api create/delete/disable/enable support tablename like ns:name #177

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

xfan001
Copy link

@xfan001 xfan001 commented Dec 6, 2021

create/delete/disable/enable action support set namespace

Copy link
Collaborator

@dethi dethi left a comment

Choose a reason for hiding this comment

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

It would also make sense if the namespace was saved in the base struct (see hrpc/call.go). This would mean that the extraction happens in the various NewX(...) function and that we can add a Namespace() []byte function to the base struct (like we already have Table() []byte)

hrpc/create.go Outdated
Comment on lines 102 to 107
namespace := []byte("default")
table := ct.table
if i := bytes.Index(table, []byte(":")); i > -1 {
namespace = table[:i]
table = table[i+1:]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This block of code is identical everywhere, can you extract it to a function that returns the namespace and table name?

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

Successfully merging this pull request may close these issues.

2 participants