-
Notifications
You must be signed in to change notification settings - Fork 86
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
[MultiDB] sonic-db-cli should support EVAL operation, app script use … #58
Conversation
@qiluo-msft we need this merged first and then we can move further on the replacement of redis-cli |
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:])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you unify both branches? execute_command
is quite general for both cases. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments.
DONE
|
#58) * [MultiDB] sonic-db-cli should support EVAL operation, app script use it in this way * unify client.execute_command
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 [email protected]