[MultiDB] sonic-db-cli should support EVAL operation, app script use …#58
Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom Dec 18, 2019
Merged
[MultiDB] sonic-db-cli should support EVAL operation, app script use …#58qiluo-msft merged 2 commits intosonic-net:masterfrom
qiluo-msft merged 2 commits intosonic-net:masterfrom
Conversation
Collaborator
Author
|
@qiluo-msft we need this merged first and then we can move further on the replacement of redis-cli |
qiluo-msft
reviewed
Dec 18, 2019
src/swsssdk/scripts/sonic-db-cli
Outdated
| keys_args = [] if numkeys == 0 else sys.argv[5:] | ||
| print client.execute_command(op, lua_script, numkeys, *keys_args) | ||
| else: | ||
| print client.execute_command(" ".join(sys.argv[2:])) |
Contributor
There was a problem hiding this comment.
Can you unify both branches? execute_command is quite general for both cases. #Closed
Contributor
Could you add one more example? And use python heredoc https://en.wikipedia.org/wiki/Here_document#Python ? #Closed Refers to: src/swsssdk/scripts/sonic-db-cli:9 in 3ab2506. [](commit_id = 3ab2506, deletion_comment = False) |
Collaborator
Author
DONE |
qiluo-msft
approved these changes
Dec 18, 2019
abdosi
pushed a commit
that referenced
this pull request
Jan 6, 2020
#58) * [MultiDB] sonic-db-cli should support EVAL operation, app script use it in this way * unify client.execute_command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sonic-db-cli should support EVAL operation, one app script use it in this way
test :
admin@ASW-7005:~$ sudo /tmp/sonic-db-cli APPL_DB EVAL "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 k1 k2 v1 v2
['k1', 'k2', 'v1', 'v2']
Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com