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

sqruff.toml support #798

Open
musjj opened this issue Sep 21, 2024 · 5 comments
Open

sqruff.toml support #798

musjj opened this issue Sep 21, 2024 · 5 comments

Comments

@musjj
Copy link

musjj commented Sep 21, 2024

TOML config support would be nice to have, especially in a Rust project.

@benfdking
Copy link
Collaborator

Hey @musjj,

Thanks for the issue; I'm just trying to understand your request exactly. You can already configure sqruff with a a .sqruff file? Is there any particular difference you mean?

@musjj
Copy link
Author

musjj commented Sep 22, 2024

.sqruff currently uses the ini format (particularly, sqlfluff's special flavor of it).

[sqlfluff]
templater = jinja

[sqlfluff:indentation]
indented_joins = False

It would be nice if we can just use toml, which is probably more familiar to Rust users:

[sqlfluff]
templater = "jinja"

[sqlfluff.indentation]
indented_joins = false

@benfdking
Copy link
Collaborator

Hey @musjj,

Thanks for clarifying! I think getting to a more robust standard is worthwhile! The toml standard is better defined, and it will be easier to build compatible tooling, I would love to give people a schema validation file!

The problem with the above is slightly more complicated as the real hurdle is unpacking the configuration code to do the above well. So, we would likely focus on that first.

I worry slightly about the audience; our users are generally "data people," and I think the most familiar configuration definition we are used to is yaml.

Ultimately, though, I think overall a strongly typed (with JSON schema) toml might be the best long-term outcome.

@quassy
Copy link

quassy commented Nov 1, 2024

Adding to this, it would be great if pyproject.toml was also supported. This would make transition from sqlfluff for Python-first projects much easier.

First time I tried sqruff I assumed because it's supposed to be compatible with sqlfluff rules that it would pick up the config and then thought sqruff was not working correctly/at all with a custom config. Only later I saw that apparently it would only pick up on .sqlfluff.

@lu-zero
Copy link

lu-zero commented Dec 20, 2024

Having a Config struct that can be used with serde probably could make dealing with toml and yaml formatting relatively painless might not be too hard. Or at least much easier than what you currently have to deal with the quirks of the sqlfluff format.

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

No branches or pull requests

4 participants