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

feat(debug): add parse_key to debug tool #7640

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

danielmai
Copy link
Contributor

@danielmai danielmai commented Mar 24, 2021

This adds a dgraph debug --parse_key flag that can return the ParsedKey
struct of a hex key. This is useful if there's a lone key that you want parse
without having to have a p directory around. This flag does not need a p
directory, just the hex key string.

Example:

$ dgraph debug --parse_key 000000000000000000000b6467726170682e74797065000000000000000001
 {d} Key: UID: 1, Attr: 0-dgraph.type, Data key

This tells you that the key 000000000000000000000b6467726170682e74797065000000000000000001
is for the predicate 0-dgraph.type and the UID 1.

docs PR: dgraph-io/dgraph-docs#636

@danielmai danielmai changed the title feat(cmd/debug): Add decode_key to debug tool. feat(cmd/debug): Add decode_key flag to debug tool. Mar 24, 2021
@danielmai danielmai changed the title feat(cmd/debug): Add decode_key flag to debug tool. feat(cmd/debug): Add parse_key flag to debug tool. Mar 24, 2021
@CLAassistant
Copy link

CLAassistant commented Apr 29, 2022

CLA assistant check
All committers have signed the CLA.

@mangalaman93 mangalaman93 changed the base branch from release/v21.03 to main August 21, 2023 06:35
@mangalaman93 mangalaman93 changed the title feat(cmd/debug): Add parse_key flag to debug tool. feat(debug): add parse_key to debug tool Aug 21, 2023
@mangalaman93 mangalaman93 force-pushed the danielmai/debug-decode-key branch 2 times, most recently from 6e44a98 to df56f5a Compare August 21, 2023 08:12
Copy link
Contributor

@all-seeing-code all-seeing-code left a comment

Choose a reason for hiding this comment

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

This is a valuable update. To ensure users are fully aware, could we also update the documentation here: https://dgraph.io/docs/howto/using-debug-tool/? Including this doc update in the PR would be beneficial, and I believe it might be a minor adjustment. Thank you!

This adds a `dgraph debug --parse_key` flag that can return the ParsedKey
struct of a hex key. This is useful if there's a lone key that you want parse
without having to have a p directory around. This flag does not need a p
directory, just the hex key string.

Example:

    $ dgraph debug --parse_key 000000000000000000000b6467726170682e74797065000000000000000001
     {d} Key: UID: 1, Attr: 0-dgraph.type, Data key

This tells you that the key 000000000000000000000b6467726170682e74797065000000000000000001
is for the predicate `0-dgraph.type` and the UID `1`.
Copy link
Contributor

@all-seeing-code all-seeing-code left a comment

Choose a reason for hiding this comment

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

Thanks!

@mangalaman93 mangalaman93 merged commit 666cf04 into main Aug 24, 2023
11 checks passed
@mangalaman93 mangalaman93 deleted the danielmai/debug-decode-key branch August 24, 2023 08:21
mangalaman93 added a commit to dgraph-io/dgraph-docs that referenced this pull request Aug 29, 2023
mangalaman93 added a commit to dgraph-io/dgraph-docs that referenced this pull request Aug 29, 2023
shivaji-kharse pushed a commit that referenced this pull request Mar 12, 2024
This adds a `dgraph debug --parse_key` flag that can return the ParsedKey
struct of a hex key. This is useful if there's a lone key that you want parse
without having to have a p directory around. This flag does not need a p
directory, just the hex key string.

Example:

$ dgraph debug --parse_key
000000000000000000000b6467726170682e74797065000000000000000001
     {d} Key: UID: 1, Attr: 0-dgraph.type, Data key

This tells you that the key
000000000000000000000b6467726170682e74797065000000000000000001
is for the predicate `0-dgraph.type` and the UID `1`.

Docs PR: dgraph-io/dgraph-docs#636

Co-authored-by: Aman Mangal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants