quarylabs / sqruff

Fast SQL formatter/linter
https://playground.quary.dev/?secondary=Format
Apache License 2.0
363 stars 14 forks source link

Do you support custom rules ? #903

Open Kiblyn11 opened 2 weeks ago

Kiblyn11 commented 2 weeks ago

Do you support extending ruleset without rebuilding the binary ? If not is it planned to do so ?

gvozdvmozgu commented 2 weeks ago

Are you looking to use some kind of scripting language to create rules?

Kiblyn11 commented 2 weeks ago

Well, looking at some rules already implemented it doesn't seem easy to do in a different language. I'm not really fond of packaging another package like SQLfluff does either, I would be happy to be able to configure a directory in Sqruff config with some rules done with the app language, but I figure this isn't an option for Rust.

Unrelated but the missing rule I would like to implement is related to detect unlimited varchar and text columns in DDL. Maybe it is something that can be implemented as part of the core rules ?

benfdking commented 2 weeks ago

We haven't focused much on analyzing DDL statements, but I don't see why we wouldn't implement a generic rule like that. It seems like a fairly generic rule that people would use, "the ability to disallow certain types".