diff --git a/lib/src/api/opt/mod.rs b/lib/src/api/opt/mod.rs index 6924c923..49f5e83c 100644 --- a/lib/src/api/opt/mod.rs +++ b/lib/src/api/opt/mod.rs @@ -231,6 +231,7 @@ fn into_json(value: Value) -> serde_json::Result { Value::Array(arr) => Ok(JsonValue::Array(Array::try_from(arr)?.0)), Value::Object(obj) => Ok(JsonValue::Object(Object::try_from(obj)?.0)), Value::Geometry(geometry) => serde_json::to_value(geometry), + Value::Bytes(bytes) => serde_json::to_value(bytes), Value::Param(param) => serde_json::to_value(param), Value::Idiom(idiom) => serde_json::to_value(idiom), Value::Table(table) => serde_json::to_value(table), diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index 8c9dff0a..e9492e3c 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -113,6 +113,7 @@ pub enum Value { Array(Array), Object(Object), Geometry(Geometry), + Bytes(Vec), // --- Param(Param), Idiom(Idiom), @@ -1399,6 +1400,7 @@ impl fmt::Display for Value { Value::Function(v) => write!(f, "{v}"), Value::Subquery(v) => write!(f, "{v}"), Value::Expression(v) => write!(f, "{v}"), + Value::Bytes(_) => write!(f, ""), } } } @@ -1466,20 +1468,21 @@ impl Serialize for Value { Value::Array(v) => s.serialize_newtype_variant(TOKEN, 9, "Array", v), Value::Object(v) => s.serialize_newtype_variant(TOKEN, 10, "Object", v), Value::Geometry(v) => s.serialize_newtype_variant(TOKEN, 11, "Geometry", v), - Value::Param(v) => s.serialize_newtype_variant(TOKEN, 12, "Param", v), - Value::Idiom(v) => s.serialize_newtype_variant(TOKEN, 13, "Idiom", v), - Value::Table(v) => s.serialize_newtype_variant(TOKEN, 14, "Table", v), - Value::Thing(v) => s.serialize_newtype_variant(TOKEN, 15, "Thing", v), - Value::Model(v) => s.serialize_newtype_variant(TOKEN, 16, "Model", v), - Value::Regex(v) => s.serialize_newtype_variant(TOKEN, 17, "Regex", v), - Value::Block(v) => s.serialize_newtype_variant(TOKEN, 18, "Block", v), - Value::Range(v) => s.serialize_newtype_variant(TOKEN, 19, "Range", v), - Value::Edges(v) => s.serialize_newtype_variant(TOKEN, 20, "Edges", v), - Value::Future(v) => s.serialize_newtype_variant(TOKEN, 21, "Future", v), - Value::Constant(v) => s.serialize_newtype_variant(TOKEN, 22, "Constant", v), - Value::Function(v) => s.serialize_newtype_variant(TOKEN, 23, "Function", v), - Value::Subquery(v) => s.serialize_newtype_variant(TOKEN, 24, "Subquery", v), - Value::Expression(v) => s.serialize_newtype_variant(TOKEN, 25, "Expression", v), + Value::Bytes(v) => s.serialize_newtype_variant(TOKEN, 12, "Bytes", v), + Value::Param(v) => s.serialize_newtype_variant(TOKEN, 13, "Param", v), + Value::Idiom(v) => s.serialize_newtype_variant(TOKEN, 14, "Idiom", v), + Value::Table(v) => s.serialize_newtype_variant(TOKEN, 15, "Table", v), + Value::Thing(v) => s.serialize_newtype_variant(TOKEN, 16, "Thing", v), + Value::Model(v) => s.serialize_newtype_variant(TOKEN, 17, "Model", v), + Value::Regex(v) => s.serialize_newtype_variant(TOKEN, 18, "Regex", v), + Value::Block(v) => s.serialize_newtype_variant(TOKEN, 19, "Block", v), + Value::Range(v) => s.serialize_newtype_variant(TOKEN, 20, "Range", v), + Value::Edges(v) => s.serialize_newtype_variant(TOKEN, 21, "Edges", v), + Value::Future(v) => s.serialize_newtype_variant(TOKEN, 22, "Future", v), + Value::Constant(v) => s.serialize_newtype_variant(TOKEN, 23, "Constant", v), + Value::Function(v) => s.serialize_newtype_variant(TOKEN, 24, "Function", v), + Value::Subquery(v) => s.serialize_newtype_variant(TOKEN, 25, "Subquery", v), + Value::Expression(v) => s.serialize_newtype_variant(TOKEN, 26, "Expression", v), } } else { match self {