DiceDB / dice

DiceDB is a redis-compliant, reactive, scalable, highly-available, unified cache optimized for modern hardware.
https://dicedb.io/
Other
6.83k stars 1.08k forks source link

Brainstorm tests: transform string to http body #1212

Open apoorvyadav1111 opened 3 weeks ago

apoorvyadav1111 commented 3 weeks ago

Hi team,

Please find a POC for using only one set of test for possibly resp, HTTP and websockets.

I have created a separate package for parser named dicedbadapter. Core idea is to use a meta file about each command and use that to decode and encode the command. Here, encode refers to encoding HTTP body to string and vice versa. This way, we can added new adapters when new commands are added. For new commands, we need to add new meta, new encoder/decoder wrappers and tests for the wrapper.

Please let me know your thoughts, if you think this can be used for all commands out there, we can pull this off using our community. For now I have support for six commands:

  1. SET: lots of optional params
  2. GET
  3. DEL
  4. MGET
  5. MSET: have key-value pairs
  6. BITOP: have required params + variable params
  7. BITFIELD: have subcommands

I would like to ensure any syntax error to be thrown by the server and not the parse. (I am working on handling extra params in HTTP body, and send them into string and let DiceDB handle syntax errors"