-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.sql
43 lines (29 loc) · 1.23 KB
/
test.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.load sqlite_jq
.echo on
select jq('{"a": "xyz"}', '.a');
select typeof(jq('{"a": "xyz"}', '.a'));
select jq('{"a": 0.5}', '.a');
select typeof(jq('{"a": 0.5}', '.a'));
select jq('{"a": "xyz"}', '.b');
select typeof(jq('{"a": "xyz"}', '.b'));
select jq('[{"a": "xyz"}, {"a": "123"}]', '.[].a');
select typeof(jq('[{"a": "xyz"}, {"a": "123"}]', '.[].a'));
select jq('["foo", "bar", "baz"]', '@csv');
select typeof(jq('["foo", "bar", "baz"]', '@csv'));
select jq('["foo", "bar", "baz"]', '@csv');
select typeof(jq('["foo", "bar", "baz"]', '@csv'));
select jq('{"a": {"hello": "world"}}', '.a');
select typeof(jq('{"a": {"hello": "world"}}', '.a'));
select json_extract(jq('{"a": {"hello": "world"}}', '.a'), '$.hello');
select typeof(json_extract(jq('{"a": {"hello": "world"}}', '.a'), '$.hello'));
select jq('{"a": ["1", "2", "3"]}', '.a');
select typeof(jq('{"a": ["1", "2", "3"]}', '.a'));
select jq('{"a": [1, 2, 3]}', '.a');
select typeof(jq('{"a": [1, 2, 3]}', '.a'));
select jq('[{"a": [1, 2, 3]}, {"a": 1}]', '.[].a');
select typeof(jq('[{"a": [1, 2, 3]}, {"a": 1}]', '.[].a'));
select jq('[]', 'this is not a query');
select jq('this is not json', 'this is not a query');
select jq(null, '.a');
select jq('', '.a');
select jq('[]', null);