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

Formatting sql text from stdin? #904

Closed
padhia opened this issue Oct 30, 2024 · 4 comments
Closed

Formatting sql text from stdin? #904

padhia opened this issue Oct 30, 2024 · 4 comments

Comments

@padhia
Copy link

padhia commented Oct 30, 2024

I couldn't figure it out from the docs, so I apologize if this is already supported. I deal with SQL code generators that produce unformatted SQL. Is there a way to pipe the generated SQL to sqruff and have the formatted SQL output to stdout?

@benfdking
Copy link
Collaborator

There is no way to do that at the moment. It looks the standard approach is via a dash as following:

echo "def x(): return 1+1" | ruff check -

@benfdking benfdking linked a pull request Oct 30, 2024 that will close this issue
@benfdking
Copy link
Collaborator

I've just pushed a version with this in it. Let me know if that works for you.

@padhia
Copy link
Author

padhia commented Nov 2, 2024

Thank you very much for the quick turnaround!

@padhia
Copy link
Author

padhia commented Nov 3, 2024

The change works great! Thanks again.

@padhia padhia closed this as completed Nov 3, 2024
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 a pull request may close this issue.

2 participants