-
Notifications
You must be signed in to change notification settings - Fork 19
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
Better lib docs? #702
Comments
Hey @max-sixty, thanks for reaching out; you are right. Our lib docs are still very rough. We're concerned about supporting this too early because we foresee some significant project changes:
We do have the API module |
Totally understand if you want to push out supporting an API a bit. Our use case is over at PRQL, we're trying to better support having expressions which aren't formatted (PRQL/prql#1284), and saw sqruff provides some abilities there; possibly more than our existing formatter. We're not in a huge rush and some level of "broad stability" is important — i.e. it's fine if we need to add a param to continue using a function, but rewriting everything because a big change would be a pain — so feel free to take your time... |
I just tried using sqruff instead of sqlformat: gvozdvmozgu/prql@ddd526e |
I didn't review the diff very closely, but it might be a good place to get test data for testing rules |
Interesting @gvozdvmozgu ! Overall I think the diff looks pretty good. The SQL is denser for short lines, which I think is a bit nicer. It occasionally is a bit odd — e.g. the hanging parenthesis here: gvozdvmozgu/prql@ddd526e#diff-dba890e435aa425a0d23bbf12de2829ce0890ebb5385d498de1bb8313bd17f83R6-R7 or the CTE here: gvozdvmozgu/prql@ddd526e#diff-148438c68d8050971a3f7dbedd92a05424b5e261322bac82a75d80a4823d481cR5-R8 ...and the indent is arguably a bit large; e.g. here: gvozdvmozgu/prql@ddd526e#diff-b9b251f91096516a3cea9e35f51c87e47ca3904a5bd21f37b9be461eb4d8bbc1R7-R14 I personally would prefer a vertical list of columns when we get ~ >3; e.g. here: gvozdvmozgu/prql@ddd526e#diff-869ab0954a91a9a604d82e6eede05371e41a7cb22a327874d994a28dc0191a98R30-R32 ...but these are all small issues. Having something reasonably stable is important to us, as well as the ability to avoid formatting s-strings (discussed in my comment above)
|
You can achieve vertical formatting by enabling certain rules that are turned off by default. I'll look into the rest later. By the way, we now have a playground: https://playground.quary.dev/ |
I wanted to check out calling
sqruff
from rust code. The rust docs are quite sparse and I don't see any examples. To the extent you're keen for folks to call the library too, would eb great to have more here! Thank you and congrats on the progress so far.The text was updated successfully, but these errors were encountered: