Commit Graph

116 Commits

Author SHA1 Message Date
Ihor Andrianov
479dd9c35a clippy 2025-03-23 21:11:35 +02:00
Ihor Andrianov
2cab36bfc3 add json_replace, jsonb_replace 2025-03-23 20:52:03 +02:00
Ihor Andrianov
c4549ad2cd split json traversal and mutation operation logic 2025-03-23 20:37:12 +02:00
Ihor Andrianov
252583cb1e add jsonb_obj jsonb_array 2025-03-20 15:22:52 +02:00
Ihor Andrianov
ca0be110ec fix big number parsing for json functions 2025-03-19 12:53:34 +02:00
Ihor Andrianov
62916f3a97 cargo clippy 2025-03-19 11:59:20 +02:00
Ihor Andrianov
32ea972151 make tests pass 2025-03-19 11:29:46 +02:00
Ihor Andrianov
b5e86a9e36 remove and replace functions defenitions 2025-03-18 21:43:48 +02:00
Ihor Andrianov
779e2c9e97 high order functions for remove and replace 2025-03-18 21:43:14 +02:00
Ihor Andrianov
403d0e8c21 implemented remove and replace in jsonb struct 2025-03-18 21:42:27 +02:00
Ihor Andrianov
328ebfcd9e clippy 2025-03-16 15:31:06 +02:00
Ihor Andrianov
23d7d82b6c add jsonb_extract function 2025-03-16 15:14:29 +02:00
Ihor Andrianov
a878738a1e Fix jsonb bug with unclosed string and two commas in a row 2025-03-16 03:27:40 +02:00
Ihor Andrianov
0b22fbd566 Add jsonb to json_valid 2025-03-16 03:26:08 +02:00
Ihor Andrianov
dc6342c0de Add jsonb impl to existing json functions where possible 2025-03-16 02:08:49 +02:00
Ihor Andrianov
e327707ac6 Fix json_path broken condition 2025-03-15 22:01:48 +02:00
Ihor Andrianov
353422a25c Add follow json path in jsonb 2025-03-15 22:00:12 +02:00
Ihor Andrianov
b366045cb7 Rewrite parser to use slice and cursor instead of iterator 2025-03-14 19:47:18 +02:00
Ihor Andrianov
ffa0b1aaca fix clippy 2025-03-12 16:08:16 +02:00
Ihor Andrianov
8a2740ad8a cleanup 2025-03-12 15:34:36 +02:00
Ihor Andrianov
eb2d2fbd69 add tests 2025-03-12 15:03:41 +02:00
Ihor Andrianov
19e4bc8523 clippy 2025-03-12 15:03:41 +02:00
Ihor Andrianov
7bd10dd577 remove warnings and dead code 2025-03-12 15:03:40 +02:00
Ihor Andrianov
04f69220b7 add jsonb function implementation and json now understands blobs 2025-03-12 15:03:40 +02:00
Ihor Andrianov
47554fda85 add serialization functions 2025-03-12 15:03:27 +02:00
Ihor Andrianov
1efc35c728 use bytes instead of parsed utf8 2025-03-12 15:03:26 +02:00
Ihor Andrianov
103c9bcb66 inital impl of json parsing 2025-03-12 15:02:49 +02:00
Pekka Enberg
1da43266e9 Merge 'Json path refine' from Ihor Andrianov
Hey! I've rebuilt the JSON path parser to make it easier to maintain and
catch more edge cases.
Main stuff:
- Removed pest dependency in favor of hand-written parser
- Better memory usage (pre-allocates space, use Cow)
- Handles quoted keys properly now
- Added tests for weird edge cases
- Added PPState (Shoutout ThePrimeagen)

Closes #970
2025-02-10 19:39:20 +02:00
Ihor Andrianov
b8b0f860d7 clippy 2025-02-10 15:34:47 +02:00
Ihor Andrianov
aad0522f56 refactor to make parser more readable 2025-02-10 15:13:36 +02:00
Ihor Andrianov
a10955cbcf refine quoted key handling, add RawString option for SQLite compat 2025-02-10 15:12:07 +02:00
Ihor Andrianov
ee16c49c6c add support for quoted path 2025-02-10 15:09:27 +02:00
Ihor Andrianov
f84a6b878a fixed edge cases and add some tests, remove pest grammar 2025-02-10 15:09:26 +02:00
Ihor Andrianov
166532cc81 simplify json path parsing 2025-02-10 15:09:23 +02:00
l.gualtieri
3487969c40 fix floating point numbers get truncated in json #877 2025-02-10 12:23:43 +01:00
pedrocarlo
41360075ba cargo clippy 2025-02-10 00:59:20 -03:00
pedrocarlo
fe453ecfc5 remove RC<String> requirement for build_text and new text 2025-02-09 13:44:39 -03:00
pedrocarlo
c3cad5dfdd corrected to use newly created as_str function to convert to string slice 2025-02-07 00:07:51 -03:00
pedrocarlo
c8bb1fd353 unreachable to agg and record types, as it should not be possible to pass them to json_quote 2025-02-06 23:43:30 -03:00
pedrocarlo
b678375c69 increasing string capacity to reduce allocations 2025-02-06 23:37:30 -03:00
pedrocarlo
90ecaf40b5 removed unnecessary string allocations for escaped json value 2025-02-06 23:37:30 -03:00
pedrocarlo
303a687e65 rebase to main 2025-02-06 23:35:58 -03:00
Pekka Enberg
f9828e0e6f core: Parse UTF-8 strings lazily 2025-02-06 13:27:52 +02:00
Pekka Enberg
0d318d810e core: Add Text::from_str() helper 2025-02-05 20:02:57 +02:00
Pekka Enberg
5abf49a0be core: Rename LimboText to Text 2025-02-05 20:02:27 +02:00
Marcus Nilsson
01492cf46f add support for json_set
Test cases are included.
Related to #127
2025-02-04 19:09:58 +01:00
Marcus Nilsson
3478352b18 move extraction of JsonPath from OwnedValue to separate function 2025-02-04 17:49:49 +01:00
Pekka Enberg
31552f0862 core/json: Kill some unwrap() calls 2025-02-04 14:55:19 +02:00
pedrocarlo
2e115d948d implement json_pretty 2025-02-01 23:04:46 -03:00
Ihor Andrianov
d968b314ed fix bug for 1 arg 2025-01-30 03:44:33 +02:00