forked from DerekStride/tree-sitter-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
json.txt
54 lines (51 loc) · 1.45 KB
/
json.txt
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
44
45
46
47
48
49
50
51
52
53
54
================================================================================
JSON traversal
================================================================================
SELECT
"user"->>'login' as login,
"user"->'address' ->> 'city',
"user"->'address' ->> 'state' as userstate,
"user" #> 'items',
"user" #>> 'more_items' AS more
FROM users;
--------------------------------------------------------------------------------
(program
(statement
(select
(keyword_select)
(select_expression
(term
value: (binary_expression
left: (literal)
right: (literal))
(keyword_as)
alias: (identifier))
(term
value: (binary_expression
left: (binary_expression
left: (literal)
right: (literal))
right: (literal)))
(term
value: (binary_expression
left: (binary_expression
left: (literal)
right: (literal))
right: (literal))
(keyword_as)
alias: (identifier))
(term
value: (binary_expression
left: (literal)
right: (literal)))
(term
value: (binary_expression
left: (literal)
right: (literal))
(keyword_as)
alias: (identifier))))
(from
(keyword_from)
(relation
(object_reference
name: (identifier))))))