We stumbled across much the same thing building out a query layer of composable join clauses. In previous efforts at something similar, I've used CTEs, but found the ergonomics worse because the query layer had to differentiate between cte clauses and regular ones.
Skimming the original article, I didn't really understand why the author didn't discuss "WITH" CTEs (for SQL newbies, common table expressions, see https://modern-sql.com/feature/with ) as alternative composition mechanisms.
Or even SQL views. But your ergonomics comment makes sense to me.
We stumbled across much the same thing building out a query layer of composable join clauses. In previous efforts at something similar, I've used CTEs, but found the ergonomics worse because the query layer had to differentiate between cte clauses and regular ones.
You raise a good point.
Skimming the original article, I didn't really understand why the author didn't discuss "WITH" CTEs (for SQL newbies, common table expressions, see https://modern-sql.com/feature/with ) as alternative composition mechanisms.
Or even SQL views. But your ergonomics comment makes sense to me.