dice
dice copied to clipboard
PR: Support for OBJECT ENCODING
This PR adds support for OBJECT ENCODING and closes #964
This PR consists of additional updates suggested on the previous PR #977 and supersedes it.
Changes :
- Support added for
OBJECT ENCODINGsubcommand, supporting the relevant encoding types available in dicedb. - Handled types and encoding using switch cases as opposed to the previous implementation in #977
- Integration tests cover all the cases in-depth.
- Unit test cases cover basic test coverage for the subcommand.
Note:
- The tests do not contain a case for the encoding type 'setint' ( ObjEncodingSetInt), as currently we do not encode sets as ints. We can add this case in the future when we integrate the functionality for encoding sets as ints.
Supported Object Types and Object Encoding:
| Object Type | Object Encoding |
|---|---|
| string | raw |
| string | embstr |
| int | int |
| bytelist | deque |
| bitset | bf |
| json | json |
| bytearray | bytearray |
| set | setstr |
| set | setint |
| hashmap | hashmap |
| sortedset | btree |
Hi @lucifercr07 @JyotinderSingh @apoorvyadav1111 - have added the new changes in this PR based on the comments in the old PR. Please review.
Thankyou.