Skip to content

Commit af89844

Browse files
authored
Merge pull request #3874 from Blargian/generate_bit_functions
Generate bit functions from source
2 parents 8b7a536 + 4114a51 commit af89844

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

scripts/settings/autogenerate-settings.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,13 @@ insert_src_files=(
315315
"experimental-beta-settings.md"
316316
"arithmetic-functions.md"
317317
"array-functions.md"
318+
"bit-functions.md"
318319
)
319320
insert_dest_files=(
320321
"docs/about-us/beta-and-experimental-features.md"
321322
"docs/sql-reference/functions/arithmetic-functions.md"
322323
"docs/sql-reference/functions/array-functions.md"
324+
"docs/sql-reference/functions/bit-functions.md"
323325
)
324326
echo "[$SCRIPT_NAME] Inserting generated markdown content between <!-- AUTOGENERATED_START --> <!-- AUTOGENERATED_END --> tags"
325327
for i in "${!insert_src_files[@]}"; do

scripts/settings/bit-functions.sql

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
WITH bit_functions AS (
2+
SELECT
3+
name,
4+
introduced_in,
5+
syntax,
6+
arguments,
7+
returned_value,
8+
examples
9+
FROM system.functions WHERE categories='Bit' 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+
if(empty(arguments), '**Arguments**\n\n- None.\n', '**Arguments**\n\n'||arguments||'\n'),
18+
'**Returned value**\n\n'||trim(returned_value)||'\n\n',
19+
'**Examples**\n\n'||examples||'\n'
20+
)
21+
FROM bit_functions
22+
INTO OUTFILE 'bit-functions.md' TRUNCATE FORMAT LineAsString

0 commit comments

Comments
 (0)