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

feat(server): Json rdb support #674

Merged
merged 1 commit into from
Jan 14, 2023
Merged

Conversation

dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Jan 13, 2023

Fixes #587

  • Support json inside rdb saver and loader
  • Add json values & commands to pytest data generator

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
tests/dragonfly/utility.py Show resolved Hide resolved
Comment on lines +543 to +546
error_code RdbSerializer::SaveJsonObject(const PrimeValue& pv) {
auto json_string = pv.GetJson()->to_string();
return SaveString(json_string);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we should maybe enable one of jsoncons extensions and use a binary format like bson

src/redis/rdb.h Show resolved Hide resolved
@dranikpg dranikpg requested a review from adiholden January 13, 2023 18:25
@@ -64,6 +65,7 @@ class ValueType(Enum):
SET = 2
HSET = 3
ZSET = 4
JSON = 5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are class fields - pythonic way to make an enum. Better than making it all just global flags

@dranikpg dranikpg merged commit dd218fa into dragonflydb:main Jan 14, 2023
@dranikpg dranikpg deleted the json-saveload branch February 27, 2023 16:39
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.

JSON type should be supported for replication and saves.
2 participants