Skip to content

Generate bit functions from source #3874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/settings/autogenerate-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,13 @@ insert_src_files=(
"experimental-beta-settings.md"
"arithmetic-functions.md"
"array-functions.md"
"bit-functions.md"
)
insert_dest_files=(
"docs/about-us/beta-and-experimental-features.md"
"docs/sql-reference/functions/arithmetic-functions.md"
"docs/sql-reference/functions/array-functions.md"
"docs/sql-reference/functions/bit-functions.md"
)
echo "[$SCRIPT_NAME] Inserting generated markdown content between <!-- AUTOGENERATED_START --> <!-- AUTOGENERATED_END --> tags"
for i in "${!insert_src_files[@]}"; do
Expand Down
22 changes: 22 additions & 0 deletions scripts/settings/bit-functions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
WITH bit_functions AS (
SELECT
name,
introduced_in,
syntax,
arguments,
returned_value,
examples
FROM system.functions WHERE categories='Bit' ORDER BY name ASC
)
SELECT
format(
'{}{}{}{}{}{}',
'## ' || name || ' ' || printf('{#%s}', name) || '\n\n',
'Introduced in: v'||introduced_in||'\n\n',
'**Syntax**\n\n'||printf('```sql\n%s\n```', syntax)||'\n\n',
if(empty(arguments), '**Arguments**\n\n- None.\n', '**Arguments**\n\n'||arguments||'\n'),
'**Returned value**\n\n'||trim(returned_value)||'\n\n',
'**Examples**\n\n'||examples||'\n'
)
FROM bit_functions
INTO OUTFILE 'bit-functions.md' TRUNCATE FORMAT LineAsString