-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_table.sql
90 lines (86 loc) · 2.37 KB
/
test_table.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.load sqlite_jq
create table test(
raw TEXT NOT NULL
);
insert into test values ('[
{
"id": "24583862139",
"type": "PushEvent",
"actor": {
"id": 71893,
"login": "mgdm",
"display_login": "mgdm",
"gravatar_id": "",
"url": "https://api.github.com/users/mgdm",
"avatar_url": "https://avatars.githubusercontent.com/u/71893?"
},
"repo": {
"id": 185476675,
"name": "mgdm/htmlq",
"url": "https://api.github.com/repos/mgdm/htmlq"
},
"payload": {
"push_id": 11320965987,
"size": 1,
"distinct_size": 1,
"ref": "refs/heads/master",
"head": "739cd363543cd5c36a2d7bcbbb3ab7e811205611",
"before": "1f5fa50722436df15d57e8627e32b68a6dc8c927",
"commits": [
{
"sha": "739cd363543cd5c36a2d7bcbbb3ab7e811205611",
"author": {
"email": "michael@mgdm.net",
"name": "Michael Maclean"
},
"message": "Add flake.nix",
"distinct": true,
"url": "https://api.github.com/repos/mgdm/htmlq/commits/739cd363543cd5c36a2d7bcbbb3ab7e811205611"
}
]
},
"public": true,
"created_at": "2022-10-13T17:52:21Z"
},
{
"id": "24583836616",
"type": "PushEvent",
"actor": {
"id": 71893,
"login": "mgdm",
"display_login": "mgdm",
"gravatar_id": "",
"url": "https://api.github.com/users/mgdm",
"avatar_url": "https://avatars.githubusercontent.com/u/71893?"
},
"repo": {
"id": 185476675,
"name": "mgdm/htmlq",
"url": "https://api.github.com/repos/mgdm/htmlq"
},
"payload": {
"push_id": 11320953650,
"size": 1,
"distinct_size": 1,
"ref": "refs/heads/master",
"head": "1f5fa50722436df15d57e8627e32b68a6dc8c927",
"before": "103bb2157fba78218e2679ce16365a769de12ccf",
"commits": [
{
"sha": "1f5fa50722436df15d57e8627e32b68a6dc8c927",
"author": {
"email": "michael.maclean@bbc.co.uk",
"name": "Michael Maclean"
},
"message": "Add flake.nix",
"distinct": true,
"url": "https://api.github.com/repos/mgdm/htmlq/commits/1f5fa50722436df15d57e8627e32b68a6dc8c927"
}
]
},
"public": true,
"created_at": "2022-10-13T17:51:04Z"
}
]');
select * from test, jq_each(test.raw, '.[].repo.name');
.exit