Skip to content
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

How to format multiple CTEs with the following CTE like ), my_other_cte AS ( #5951

Open
3 tasks done
vitorbaptista opened this issue Jun 5, 2024 · 0 comments
Open
3 tasks done
Labels
documentation Add or improve documentation (including error messages)

Comments

@vitorbaptista
Copy link

Search before asking

  • I searched the issues and found no similar issues.

Links or command line

No response

Issue/Suggested Improvement

This isn't a documentation issue, but I didn't find a better place to ask this question.

I like to format my SQL files like:

WITH foo AS (
    SELECT
        *
    FROM my_table

), bar AS (
    SELECT
        *
    FROM my_other_table

)

SELECT
  *
FROM foo
INNER JOIN bar USING (id)

The important part is the CTEs. I searched your docs but the best I could do was:

WITH foo AS (
    SELECT
        *
    FROM my_table

)

, bar AS (
    SELECT
        *
    FROM my_other_table

)

SELECT
  *
FROM foo
INNER JOIN bar USING (id)

Notice that the bar CTE is in a different line. Is there an option to make it format like the first option? If not, would you be OK with me submitting a PR for this?

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

@vitorbaptista vitorbaptista added the documentation Add or improve documentation (including error messages) label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Add or improve documentation (including error messages)
Projects
None yet
Development

No branches or pull requests

1 participant