Skip to content

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

Open
xfan001 wants to merge 7 commits into
tsuna:masterfrom
xfan001:admin_ns
Open

admin api create/delete/disable/enable support tablename like ns:name#177
xfan001 wants to merge 7 commits into
tsuna:masterfrom
xfan001:admin_ns

Conversation

@xfan001

@xfan001 xfan001 commented Dec 6, 2021

Copy link
Copy Markdown

create/delete/disable/enable action support set namespace

@dethi dethi left a comment

Copy link
Copy Markdown
Collaborator

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)

Comment thread 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
Copy Markdown
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