Commit graph

138 commits

Author SHA1 Message Date
Pekka Enberg
e3f71259d8 Rename OwnedValue -> Value
We have not had enough merge conflicts for a while so let's do a
tree-wide rename.
2025-05-15 09:59:46 +03:00
Pekka Enberg
5a60815484 core/json: Remove redundant conditional compilation
The top-level `json` module declaration is already conditional on "json"
feature so no need to do it here.
2025-03-31 09:40:01 +03:00
Pekka Enberg
6258dda5f1 core/json: Rename json_path.rs to path.rs 2025-03-31 09:40:01 +03:00
Pekka Enberg
4a91988755 core/json: Rename json_operations.rs to ops.rs 2025-03-31 09:33:30 +03:00
Pekka Enberg
4b77f52bac core/json: Rename json_cache.rs to cache.rs 2025-03-31 09:32:34 +03:00
Ihor Andrianov
db5e364210
made json an optional module again 2025-03-30 19:01:03 +03:00
Ihor Andrianov
6c126dcd97
add jsonb_set 2025-03-30 18:58:40 +03:00
Ihor Andrianov
dba82b40e3
add compat tests 2025-03-30 18:58:40 +03:00
Ihor Andrianov
92a745ca49
fix tests 2025-03-30 18:58:39 +03:00
Ihor Andrianov
101dd51d7c
add jsonb_group_object and array 2025-03-30 18:58:39 +03:00
Ihor Andrianov
c426c13763
make tests pass 2025-03-30 18:58:38 +03:00
Ihor Andrianov
568dc54b9e
big cleanup 2025-03-30 18:58:33 +03:00
Ihor Andrianov
a983c979c6
jsonb_merge, json_group_array, json_group_object 2025-03-30 18:47:33 +03:00
Pere Diaz Bou
a13b33fec9 clippy again 2025-03-29 22:07:43 +01:00
Pere Diaz Bou
d9f5cd870d clippy 2025-03-29 22:04:08 +01:00
Pere Diaz Bou
5b7fcd27bd make column reuse blob/text fields 2025-03-29 22:02:49 +01:00
Pere Diaz Bou
9291f60722 Introduce Register struct
OwnedValue has become a powerhouse of madness, mainly because I decided
to do it like that when I first introduced AggContext. I decided it was
enough and I introduced a `Register` struct that contains `OwnedValue`,
`Record` and `Aggregation`, this way we don't use `OwnedValue` for
everything make everyone's life harder.

This is the next step towards making ImmutableRecords the default
because I want to remove unnecessary allocations. Right now we clone
OwnedValues when we generate a record more than needed.
2025-03-27 17:53:02 +01:00
Ihor Andrianov
59f00ff0c3
fix not removing lock if cache did not exist 2025-03-24 15:09:18 +02:00
Ihor Andrianov
d8e070a360
moved json_cache to state 2025-03-24 14:48:40 +02:00
Ihor Andrianov
e5199b0f1a
add tests 2025-03-24 13:17:59 +02:00
Ihor Andrianov
1511c9b3bf
add json cache to json functions and fix tests 2025-03-24 13:17:58 +02:00
Ihor Andrianov
615de2a0d3
add json_cache struct 2025-03-24 13:17:57 +02:00
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