chore: consolidate json code under core/json (#2609)

Fix linker dependencies - now dfly_core depends on jsonpath.
jsonpath does not depend on CompactObject anymore.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-02-18 11:22:34 +02:00 committed by GitHub
parent 1ba59e9179
commit d802a2181a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 36 additions and 39 deletions

View file

@ -22,8 +22,8 @@ extern "C" {
#include "base/flags.h"
#include "base/logging.h"
#include "core/json/driver.h"
#include "core/json/json_object.h"
#include "core/json/jsonpath_grammar.hh"
#include "core/json_object.h"
#include "facade/cmd_arg_parser.h"
#include "server/acl/acl_commands_def.h"
#include "server/command_registry.h"
@ -132,6 +132,10 @@ string JsonTypeToName(const JsonType& val) {
return std::string{};
}
inline std::optional<JsonType> JsonFromString(std::string_view input) {
return dfly::JsonFromString(input, CompactObj::memory_resource());
}
io::Result<JsonExpression> ParseJsonPath(string_view path) {
if (path == ".") {
// RedisJson V1 uses the dot for root level access.