Re: [PATCH] WIP: replace method for jsonpath

2024-09-19 Thread Florents Tselai
On 18 Sep 2024, at 3:47 PM, Andrew Dunstan wrote: On 2024-09-18 We 4:23 AM, Peter Eisentraut wrote: On 17.09.24 21:16, David E. Wheeler wrote: On Sep 17, 2024, at 15:03, Florents Tselai wrote: Fallback scenario: make this an extension, but in a first pass I didn’t find any convenient hooks.

Re: [PATCH] WIP: replace method for jsonpath

2024-09-18 Thread Andrew Dunstan
On 2024-09-18 We 4:23 AM, Peter Eisentraut wrote: On 17.09.24 21:16, David E. Wheeler wrote: On Sep 17, 2024, at 15:03, Florents Tselai wrote: Fallback scenario: make this an extension, but in a first pass I didn’t find any convenient hooks. One has to create a whole new scanner, grammar

Re: [PATCH] WIP: replace method for jsonpath

2024-09-18 Thread Florents Tselai
> On 18 Sep 2024, at 11:23 AM, Peter Eisentraut wrote: > > On 17.09.24 21:16, David E. Wheeler wrote: >> On Sep 17, 2024, at 15:03, Florents Tselai wrote: >>> Fallback scenario: make this an extension, but in a first pass I didn’t >>> find any convenient hooks. >>> One has to create a whole n

Re: [PATCH] WIP: replace method for jsonpath

2024-09-18 Thread Peter Eisentraut
On 17.09.24 21:16, David E. Wheeler wrote: On Sep 17, 2024, at 15:03, Florents Tselai wrote: Fallback scenario: make this an extension, but in a first pass I didn’t find any convenient hooks. One has to create a whole new scanner, grammar etc. Yeah, it got me thinking about the RFC-9535 JSO

Re: [PATCH] WIP: replace method for jsonpath

2024-09-17 Thread David E. Wheeler
On Sep 17, 2024, at 15:03, Florents Tselai wrote: > Fallback scenario: make this an extension, but in a first pass I didn’t find > any convenient hooks. > One has to create a whole new scanner, grammar etc. Yeah, it got me thinking about the RFC-9535 JSONPath "Function Extension" feature[1], w

Re: [PATCH] WIP: replace method for jsonpath

2024-09-17 Thread Florents Tselai
> On 17 Sep 2024, at 9:40 PM, David E. Wheeler wrote: > > On Sep 16, 2024, at 18:39, Florents Tselai wrote: > >> Here’s an updated version of this patch. > > Oh, nice function. > > But a broader question for hackers: Is replace() specified in the SQL/JSON > spec? If not, what’s the proces

Re: [PATCH] WIP: replace method for jsonpath

2024-09-17 Thread David E. Wheeler
On Sep 16, 2024, at 18:39, Florents Tselai wrote: > Here’s an updated version of this patch. Oh, nice function. But a broader question for hackers: Is replace() specified in the SQL/JSON spec? If not, what’s the process for evaluating whether or not to add features not specified by the spec?

Re: [PATCH] WIP: replace method for jsonpath

2024-09-16 Thread Florents Tselai
Here’s an updated version of this patch.The previous version failed several CI steps; this passes them all.Unless someone disagrees,I’ll proceed with the documentation and add this for the next CF.As a future note:It’s worth noting that both this newly added jspItem and other ones like (jpiDecimal,

[PATCH] WIP: replace method for jsonpath

2024-09-14 Thread Florents Tselai
Hi,When working with jsonb/jsonpath, I’ve always wanted more fluent string operations for data cleaning.Ideally, chaining text processing methods together.Here’s a draft patch that adds a string replace method.It works like thisselect jsonb_path_query('"hello world"', '$.replace("hello","bye")'); j