Module json

Module json 

Source
Expand description

Data conversion between greptime’s StructType and Json

The idea of this module is to provide utilities to convert serde_json::Value to greptime’s StructType and vice versa.

The struct will carry all the fields of the Json object. We will not flatten any json object in this implementation.

Structs§

JsonContext
Context for JSON encoding/decoding that tracks the current key path

Enums§

JsonStructureSettings
The configuration of JSON encoding

Functions§

decode_list_with_context 🔒
Decode a list value to JSON array
decode_list_with_settings 🔒
Decode a ListValue that was encoded with current settings back into a fully structured ListValue
decode_primitive_value 🔒
Decode primitive value to JSON
decode_struct_with_context 🔒
Decode a structured value to JSON object
decode_struct_with_settings 🔒
Decode a StructValue that was encoded with current settings back into a fully structured StructValue
decode_unstructured_raw_struct 🔒
Helper function to decode a struct that was encoded with UnstructuredRaw settings
decode_unstructured_value 🔒
Decode unstructured value (stored as string)
decode_value_with_context
Main decoding function with key path tracking
encode_json_array_with_context 🔒
encode_json_object_with_context 🔒
encode_json_value_with_context 🔒
Helper function to encode a JSON value to a Value and determine its ConcreteDataType with context
encode_json_with_context
Main encoding function with key path tracking
try_convert_to_expected_type 🔒
Helper function to try converting a value to an expected type