|
6 | 6 | FROM file(cpp_file, LineAsString) |
7 | 7 | WHERE match(line, '^\\s*DECLARE\\(') |
8 | 8 | ), |
| 9 | + setting_aliases AS |
| 10 | + ( |
| 11 | + SELECT |
| 12 | + alias_for, |
| 13 | + groupArray(name) AS aliases |
| 14 | + FROM system.settings |
| 15 | + WHERE alias_for != '' |
| 16 | + AND alias_for IN settings_from_cpp |
| 17 | + GROUP BY alias_for |
| 18 | + ), |
9 | 19 | main_content AS |
10 | 20 | ( |
11 | | - SELECT format('## {} {} {} \n\n{}\n\n{}\n\n', |
12 | | - name, |
13 | | - '{#'||name||'}', |
14 | | - multiIf(tier == 'Experimental', '<ExperimentalBadge/>', tier == 'Beta', '<BetaBadge/>', ''), |
15 | | - if(type != '' AND default != '', format('<SettingsInfoBlock type="{}" default_value="{}" />', type, default), ''), |
16 | | - trim(BOTH '\\n' FROM description)) |
17 | | - FROM system.settings WHERE name IN settings_from_cpp |
18 | | - ORDER BY name |
| 21 | + SELECT format('## {} {} {} \n\n{}{}\n\n{}\n\n', |
| 22 | + s.name, |
| 23 | + '{#'||s.name||'}', |
| 24 | + multiIf(s.tier == 'Experimental', '<ExperimentalBadge/>', s.tier == 'Beta', '<BetaBadge/>', ''), |
| 25 | + if(sa.aliases IS NOT NULL AND length(sa.aliases) > 0, |
| 26 | + '**Aliases**: ' || arrayStringConcat(arrayMap(x -> '`' || x || '`', sa.aliases), ', ') || '\n\n', |
| 27 | + ''), |
| 28 | + if(s.type != '' AND s.default != '', format('<SettingsInfoBlock type="{}" default_value="{}" />', s.type, s.default), ''), |
| 29 | + trim(BOTH '\\n' FROM s.description)) |
| 30 | + FROM system.settings s |
| 31 | + LEFT JOIN setting_aliases sa ON s.name = sa.alias_for |
| 32 | + WHERE s.name IN settings_from_cpp |
| 33 | + ORDER BY s.name |
19 | 34 | ), |
20 | 35 | '' || |
21 | 36 | '--- |
|
0 commit comments