miniredis icon indicating copy to clipboard operation
miniredis copied to clipboard

Simple support for `DUMP` and `RESTORE`

Open alyssaruth opened this issue 7 months ago • 2 comments

Closes #401

Simple implementation for DUMP and RESTORE which just supports string keys:

  • Attempting to dump a different key type will produce WRONGTYPE Operation against a key holding the wrong kind of value
  • For RESTORE I've implemented the REPLACE and ABSTTL optional flags, but not IDLETIME or FREQ (wasn't immediately obvious to me what these were :woman_shrugging: )

I have also:

  • Renamed the existing Dump to DebugDump to avoid confusion
  • Extracted constants for the various key types
  • Collected common validation into validCMD and plugged it in for all the existing generic commands. Happy to do this for the remainder as well if the approach looks good to you :smile:

alyssaruth avatar May 17 '25 22:05 alyssaruth

On Sat, May 17, 2025 at 03:53:02PM -0700, Alyssa wrote:

Closes #401

Simple implementation for DUMP and RESTORE which just supports string keys:

Thanks! I'll have a look soon.

alicebob avatar May 19 '25 06:05 alicebob

(not forgotten, just busy)

alicebob avatar Jun 02 '25 06:06 alicebob

Looks good! I merged the first commit to master, since that was an easy one.

Renamed the existing Dump to DebugDump to avoid confusion

I don't think we can do that, it changes existing code.

alicebob avatar Jun 04 '25 08:06 alicebob

thanks for your replies! I'll get back to you.

alicebob avatar Jun 04 '25 20:06 alicebob

sorry for the delay. PR looks great and I'll merge it, but I do prefer to keep .Dump() named as is. I know it's an unlucky name, but I don't want to introduce a breaking change.

alicebob avatar Jun 11 '25 13:06 alicebob

sorry for the delay. PR looks great and I'll merge it, but I do prefer to keep .Dump() named as is. I know it's an unlucky name, but I don't want to introduce a breaking change.

Ok! I've reverted that part of the change :+1:

alyssaruth avatar Jun 13 '25 19:06 alyssaruth

Thanks! And sorry again for the slow reviewing.

alicebob avatar Jun 14 '25 07:06 alicebob