mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 10:14:21 +01:00
Merge 'Add support for json_object function' from Jorge Hermo
Relates to #127. This PR is still in draft and I have a few left things to do (tests, improve implementation), just opening it so anyone can track this work meanwhile. Closes #664
This commit is contained in:
@@ -76,6 +76,7 @@ pub enum JsonFunc {
|
||||
JsonArrowExtract,
|
||||
JsonArrowShiftExtract,
|
||||
JsonExtract,
|
||||
JsonObject,
|
||||
JsonType,
|
||||
JsonErrorPosition,
|
||||
}
|
||||
@@ -93,6 +94,7 @@ impl Display for JsonFunc {
|
||||
Self::JsonArrayLength => "json_array_length".to_string(),
|
||||
Self::JsonArrowExtract => "->".to_string(),
|
||||
Self::JsonArrowShiftExtract => "->>".to_string(),
|
||||
Self::JsonObject => "json_object".to_string(),
|
||||
Self::JsonType => "json_type".to_string(),
|
||||
Self::JsonErrorPosition => "json_error_position".to_string(),
|
||||
}
|
||||
@@ -510,6 +512,8 @@ impl Func {
|
||||
#[cfg(feature = "json")]
|
||||
"json_extract" => Ok(Func::Json(JsonFunc::JsonExtract)),
|
||||
#[cfg(feature = "json")]
|
||||
"json_object" => Ok(Func::Json(JsonFunc::JsonObject)),
|
||||
#[cfg(feature = "json")]
|
||||
"json_type" => Ok(Func::Json(JsonFunc::JsonType)),
|
||||
#[cfg(feature = "json")]
|
||||
"json_error_position" => Ok(Self::Json(JsonFunc::JsonErrorPosition)),
|
||||
|
||||
Reference in New Issue
Block a user