Debian Codegraph @

test/command/suite/load/json/object/nested.test

raw
1 #@require-feature simdjson
2
3 table_create Notes TABLE_NO_KEY
4 column_create Notes data COLUMN_SCALAR JSON
5
6 # Source:
7 # {
8 # "string": "world",
9 # "integer": 29,
10 # "object": {
11 # "null": null,
12 # "array": [
13 # null,
14 # {
15 # "array_object_array": [-2.9]
16 # },
17 # true
18 # ],
19 # "sub_object": {
20 # "false": false,
21 # "double": 2.9
22 # },
23 # "object_integer": 2929
24 # },
25 # "true": true
26 # }
27 # JSONify:
28 # 1. ruby -r json -e 'puts JSON.parse(ARGF.read.gsub(/^#/, "")).to_json.to_json'
29 # 2. Paste the above source with comment to the stdin of 1.
30 load --table Notes
31 [
32 {"data": "{\"string\":\"world\",\"integer\":29,\"object\":{\"null\":null,\"array\":[null,{\"array_object_array\":[-2.9]},true],\"sub_object\":{\"false\":false,\"double\":2.9},\"object_integer\":2929},\"true\":true}"}
33 ]
34
35 select Notes
36
37 dump