Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add additional jsonpath string methods #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

theory
Copy link
Owner

@theory theory commented May 24, 2025

Add the following jsonpath methods:

  • l/r/btrim()
  • lower(), upper()
  • initcap()
  • replace()
  • split_part()

Each simply dispatches to the standard string processing functions. These depend on the locale, but since it's set at initdb, they can be considered immutable and therefore allowed in any jsonpath expression.

@theory theory self-assigned this May 24, 2025
@theory theory force-pushed the more-jsonpath-methods branch 3 times, most recently from 6c61d21 to b996d19 Compare May 28, 2025 17:29
@theory theory force-pushed the more-jsonpath-methods branch 8 times, most recently from 934740d to 69682b4 Compare June 3, 2025 18:37
Rename the `csv_` tokens to `int_`, because they represent signed or
unsigned integers, as follows:

*   `csv_elem` => `int_elem`
*   `csv_list` => `int_list`
*   `opt_csv_list` => `opt_int_list`

Rename the `datetime_precision` tokens to `uint_arg`, as they represent
unsigned integers and will be useful for other methods in the future, as
follows:

*   `datetime_precision` => `uint_elem`
*   `opt_datetime_precision` => `opt_uint_arg`

Rename the `datetime_template` tokens to `str_arg`, as they represent
strings and will be useful for other methods in the future, as follows:

*   `datetime_template` => `str_elem`
*   `opt_datetime_template` => `opt_str_arg`
@theory theory force-pushed the more-jsonpath-methods branch 5 times, most recently from 1e80d72 to f3eb863 Compare June 3, 2025 19:23
Add the following jsonpath methods:

*   l/r/btrim()
*   lower(), upper()
*   initcap()
*   replace()
*   split_part()

Each simply dispatches to the standard string processing functions.
These depend on the locale, but since it's set at `initdb`, they can be
considered immutable and therefore allowed in any jsonpath expression.
@theory theory force-pushed the more-jsonpath-methods branch from f3eb863 to 8f2146a Compare June 4, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants