add json_replace, jsonb_replace

This commit is contained in:
Ihor Andrianov
2025-03-23 20:52:03 +02:00
parent c4549ad2cd
commit 2cab36bfc3
5 changed files with 79 additions and 99 deletions

View File

@@ -89,6 +89,8 @@ pub enum JsonFunc {
JsonbRemove,
JsonReplace,
JsonbReplace,
JsonInsert,
JsonbInsert,
JsonPretty,
JsonSet,
JsonQuote,
@@ -120,6 +122,8 @@ impl Display for JsonFunc {
Self::JsonbRemove => "jsonb_remove".to_string(),
Self::JsonReplace => "json_replace".to_string(),
Self::JsonbReplace => "jsonb_replace".to_string(),
Self::JsonInsert => "json_insert".to_string(),
Self::JsonbInsert => "jsonb_insert".to_string(),
Self::JsonPretty => "json_pretty".to_string(),
Self::JsonSet => "json_set".to_string(),
Self::JsonQuote => "json_quote".to_string(),
@@ -593,6 +597,10 @@ impl Func {
#[cfg(feature = "json")]
"json_replace" => Ok(Self::Json(JsonFunc::JsonReplace)),
#[cfg(feature = "json")]
"json_insert" => Ok(Self::Json(JsonFunc::JsonInsert)),
#[cfg(feature = "json")]
"jsonb_insert" => Ok(Self::Json(JsonFunc::JsonbInsert)),
#[cfg(feature = "json")]
"jsonb_replace" => Ok(Self::Json(JsonFunc::JsonReplace)),
#[cfg(feature = "json")]
"json_pretty" => Ok(Self::Json(JsonFunc::JsonPretty)),