Debian Codegraph @

test/command/suite/select/drilldown/labeled/table/two.test

raw
1 table_create Categories TABLE_PAT_KEY ShortText
2 column_create Categories sub_category COLUMN_SCALAR ShortText
3
4 table_create Tags TABLE_PAT_KEY ShortText
5 column_create Tags category COLUMN_SCALAR Categories
6
7 table_create Memos TABLE_HASH_KEY ShortText
8 column_create Memos tag COLUMN_SCALAR Tags
9
10 load --table Memos
11 [
12 {"_key": "Groonga is fast!", "tag": "Groonga"},
13 {"_key": "Mroonga is fast!", "tag": "Mroonga"},
14 {"_key": "Groonga sticker!", "tag": "Groonga"},
15 {"_key": "Rroonga is fast!", "tag": "Rroonga"}
16 ]
17
18 load --table Tags
19 [
20 {"_key": "Groonga", "category": "C/C++"},
21 {"_key": "Mroonga", "category": "C/C++"},
22 {"_key": "Rroonga", "category": "Ruby"}
23 ]
24
25 load --table Categories
26 [
27 {"_key": "C/C++", "sub_category": "Programming language"},
28 {"_key": "Ruby", "sub_category": "Programming language"}
29 ]
30
31 select Memos \
32 --drilldown[category].table tag \
33 --drilldown[category].keys category \
34 --drilldown[category].output_columns _key,_nsubrecs,sub_category \
35 --drilldown[sub_category].table category \
36 --drilldown[sub_category].keys sub_category \
37 --drilldown[sub_category].output_columns _key,_nsubrecs \
38 --drilldown[tag].keys tag \
39 --drilldown[tag].output_columns _key,_nsubrecs,category