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

Add DUMP #27

Merged
merged 8 commits into from
Jun 6, 2019
Merged

Add DUMP #27

merged 8 commits into from
Jun 6, 2019

Conversation

hltbra
Copy link
Contributor

@hltbra hltbra commented Jun 4, 2019

Fixes #25

This pull request doesn't treat specially optimized cases, such as intsets and ziplists, but it's still a fully compatible output:

# dredis
$ redis-cli -p 6377
127.0.0.1:6377> set dredis_foo bar
OK
127.0.0.1:6377> dump dredis_foo
"\x00\x03bar\a\x00\x19\x8c\x9c\x93\xe6\xac(\r"
127.0.0.1:6377> zadd dredis_z 0 value0 1 value1
(integer) 2
127.0.0.1:6377> dump dredis_z
"\x03\x02\x06value0\x010\x06value1\x011\a\x00,\xf1\x99\xda#.3="
# redis
$ redis-cli -p 6379
127.0.0.1:6379> restore redis_foo 0 "\x00\x03bar\a\x00\x19\x8c\x9c\x93\xe6\xac(\r"
OK
127.0.0.1:6379> get redis_foo
"bar"
127.0.0.1:6379> restore redis_z 0 "\x03\x02\x06value0\x010\x06value1\x011\a\x00,\xf1\x99\xda#.3="
OK
127.0.0.1:6379> zrange redis_z 0 -1 withscores
1) "value0"
2) "0"
3) "value1"
4) "1"

@hltbra hltbra merged commit 600106c into master Jun 6, 2019
@hltbra hltbra deleted the feature/dump branch June 6, 2019 17:56
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.

Implement DUMP
1 participant