I’m setting up SQLFluff to lint my BigQuery SQL files, and I want to apply some customized align logic.
I’ve read their documentation about Aligned Elements, and have been able to align column aliases like so:
SELECT
a AS first_column,
b AS second_column,
(a + b) / 2 AS third_column
FROM foo AS bar
What I want to do next is something similar, but for the tables and joins listed in the FROM clause. I would want to go from:
SELECT *
FROM table AS t
LEFT JOIN table_two AS t2_alias ON t2_alias.t_id = t.id
LEFT JOIN table_three AS t3 ON t3.t_id = t.id
to:
SELECT *
FROM table AS t
LEFT JOIN table_two AS t2_alias ON t2_alias.t_id = t.id
LEFT JOIN table_three AS t3 ON t3.t_id = t.id
Is this possible?
New contributor
Devin Norris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.