Qovery / RedisLess

RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.
MIT License
150 stars 16 forks source link

draft: add TYPE command #37

Closed tbmreza closed 3 years ago

tbmreza commented 3 years ago

How do you test a new command? I'm not sure if I'm already on the right direction, i.e., if I only need to figure out what to feed send_packed_command() with, and how to receive the connection's response.

28

evoxmusic commented 3 years ago

If a command is not available via the Redis Rust client you can use send_packed_command(...) - is it correct @clarity0? I didn't have the time to try this command since I am working on the raft implementation

clarity0 commented 3 years ago

@tbmreza I havent tested it out extensively but according to the redis-rs docs changes the state of the connection or something, and my test for the GETDEL command only behaved as expected when I called get twice. I just gave up testing that out because no Redis client I've seen implements GETDEL and it's deprecated apparently. see my comment here

clarity0 commented 3 years ago

I think the python redis client does implement TYPE unlike redis-rs. You could test it out with that, because send_packed_command just ignores the response from the server.

clarity0 commented 3 years ago

Does it work well with the python client?

tbmreza commented 3 years ago

Does it work well with the python client?

Should I test it thoroughly? If so, do I put them (SET and TYPE commands for every DataType) all in main.py? @clarity0

tbmreza commented 3 years ago

for the 1 TYPE command I tested in python client, yes it works well (the assertion doesn't fail)

clarity0 commented 3 years ago

Right now there is only support commands that add strings so you can't really test the other cases with a client but they should work fine.

evoxmusic commented 3 years ago

@clarity0 @tbmreza good to be merged?

evoxmusic commented 3 years ago

@tbmreza can you rebase?

tbmreza commented 3 years ago

@tbmreza can you rebase?

sure but I'm not a capable git user. could you tell me how to do it, step by step?

tbmreza commented 3 years ago

I'm closing this PR. Currently looking at other good first issues (#23 if it doesn't turn out to be too hard for me), will open new PR covering that and #28. Thanks for bearing with me!