Skip to content

Commit 64040ba

Browse files
authored
Merge pull request #3846 from ClickHouse/autogen_arithmetic_functions
Functions: autogenerate arithmetic functions
2 parents 07b67a3 + 8b0d183 commit 64040ba

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
WITH arithmetic_functions AS (
2+
SELECT
3+
name,
4+
introduced_in,
5+
syntax,
6+
arguments,
7+
returned_value,
8+
examples
9+
FROM system.functions WHERE categories='Arithmetic' ORDER BY name ASC
10+
)
11+
SELECT
12+
format(
13+
'{}{}{}{}{}{}',
14+
'## ' || name || ' ' || printf('{#%s}', name) || '\n\n',
15+
'Introduced in: v'||introduced_in||'\n\n',
16+
'**Syntax**\n\n'||printf('```sql\n%s\n```', syntax)||'\n\n',
17+
'**Arguments**\n\n'||arguments||'\n',
18+
'**Returned value**\n\n'||trim(returned_value)||'\n\n',
19+
'**Examples**\n\n'||examples||'\n'
20+
)
21+
FROM arithmetic_functions
22+
INTO OUTFILE 'arithmetic-functions.md' TRUNCATE FORMAT LineAsString

scripts/settings/autogenerate-settings.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,13 @@ for i in "${!append_src_files[@]}"; do
311311
done
312312

313313
# --- Append content between <!-- AUTOGENERATED_START --><!-- AUTOGENERATED_END --> tags on the page
314-
insert_src_files=("experimental-beta-settings.md")
314+
insert_src_files=(
315+
"experimental-beta-settings.md"
316+
"arithmetic-functions.md"
317+
)
315318
insert_dest_files=(
316319
"docs/about-us/beta-and-experimental-features.md"
320+
"docs/sql-reference/functions/arithmetic-functions.md"
317321
)
318322
echo "[$SCRIPT_NAME] Inserting generated markdown content between <!-- AUTOGENERATED_START --> <!-- AUTOGENERATED_END --> tags"
319323
for i in "${!insert_src_files[@]}"; do

0 commit comments

Comments
 (0)