Skip to content

Try to standardize formatting for CREATE FUNCTION#647

Merged
jeltz merged 1 commit intopercona:mainfrom
jeltz:sql-formatting
Apr 8, 2026
Merged

Try to standardize formatting for CREATE FUNCTION#647
jeltz merged 1 commit intopercona:mainfrom
jeltz:sql-formatting

Conversation

@jeltz
Copy link
Copy Markdown
Contributor

@jeltz jeltz commented Apr 7, 2026

The ways we wrote CREATE FUNCTION were all over the place so this is an attempt at standardizing how we write SQL functions without changing the semantic meaning of any of the upgrade scripts.

The goals of this is to make sure we always write things in the same order and that we put the function body last. We also skip declaring VOLATILE since that is the default.

Feel free to suggest a totally different formatting, this is just one way to do it, and I mostly care about us writing things in a uniform way.

@jeltz jeltz force-pushed the sql-formatting branch 2 times, most recently from bde3a73 to d2e24e3 Compare April 7, 2026 13:44
@AndersAstrand
Copy link
Copy Markdown
Contributor

AndersAstrand commented Apr 7, 2026

I've not wanted to change these files until we do new versions, but i guess we could. I think the bigger issue with them is the numbered OUT arguments that have the completely wrong numbers :D.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.47%. Comparing base (34c0673) to head (9e06172).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #647      +/-   ##
==========================================
+ Coverage   86.32%   86.47%   +0.14%     
==========================================
  Files           3        3              
  Lines        1346     1346              
  Branches      217      217              
==========================================
+ Hits         1162     1164       +2     
+ Misses         87       86       -1     
+ Partials       97       96       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz
Copy link
Copy Markdown
Contributor Author

jeltz commented Apr 7, 2026

@AndersAstrand It was when I was contemplating fixing some of the more serious issues I got annoyed at the lack of consistency. This PR is just about making things nicer to work with for when fixing the actual real issues.

Comment thread pg_stat_monitor--2.0.sql Outdated
The ways we wrote CREATE FUNCTION were all over the place so this is an
attempt at standardizing how we write SQL functions without changing the
semantic meaning of any of the upgrade scripts.

The goals of this is to make sure we always write things in the same
order and that we put the function body last. We also skip declaring
VOLATILE since that is the default.
@jeltz jeltz merged commit 12b2595 into percona:main Apr 8, 2026
70 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants