Slightly orthogonal but a less destructive way of 'Fuck this noise' is to use worktrees. They were a game-changer for me. I often have several tasks on the go and it's really useful to have different branches in different directories and not have to stash changes if I need to quickly switch to a different task.
It's also not obvious to me what has been gained from introducing a function which takes 5 unnamed arguments. Without looking at some separate (and therefore possibly wrong) documentation there's no way to guess what it's doing. Writing the SQL may take a bit longer but reading and understanding it is far easier.
What other approaches to making SQL composable can we imagine? With functions it seems very simple to extract a WHERE clause into a predicate of some sort. I'm sure even if this exact syntax isn't preferable, being able to reuse join logic would be great.
That said, in the case of wanting to abstract out or reuse joins, just write a view, I guess. And I get a lot of mileage in Postgres from just writing functions to abstract out predicates, because it allows you to write things like `select * from order where order.is_complete` instead of `where is_complete(order)`
How does looking at the ratio of positive/negative Covid-19 test results after being admitted to hospital for Covid-19 symptoms bear any relation to balding being a risk factor?