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

DBT support #331

Open
ikhudur opened this issue May 24, 2024 · 11 comments
Open

DBT support #331

ikhudur opened this issue May 24, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@ikhudur
Copy link

ikhudur commented May 24, 2024

Hello,

I have just installed sqruff by following the README.md file https://github.com/quarylabs/sqruff/blob/c2850ab65f350932612a1cd5c5d89d255f3da81f/README.md#linux

When I run sqruff lint I get the following error:

thread 'main' panicked at crates/lib/src/core/config.rs:471:25:
not implemented
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace

Could you please help me with this?

More info:
I use WSL2
I do not have Rust installed

Best regards,
Ivan

@gvozdvmozgu
Copy link
Collaborator

gvozdvmozgu commented May 24, 2024

What sqlfluff config do you use?

@ikhudur
Copy link
Author

ikhudur commented May 24, 2024

My apologise, what do you mean by what config I am using?

@gvozdvmozgu
Copy link
Collaborator

gvozdvmozgu commented May 24, 2024

Do you have a .sqlfluff file?

@ikhudur
Copy link
Author

ikhudur commented May 24, 2024

Yes, the .sqlfluff looks like this:

[sqlfluff]
dialect = databricks
templater = dbt
rules = all
exclude_rules = ST06
max_line_length = 150

[sqlfluff:templater:jinja]
apply_dbt_builtins = True

[sqlfluff:templater:dbt]
project_dir = ./
profiles_dir = .
profile = db
target = dev

[sqlfluff:rules]
allow_scalar = True
single_table_references = consistent
unquoted_identifiers_policy = all

[sqlfluff:rules:capitalisation.keywords]
capitalisation_policy = upper

[sqlfluff:rules:capitalisation.types]
extended_capitalisation_policy = upper

[sqlfluff:rules:capitalisation.identifiers]
extended_capitalisation_policy = lower

[sqlfluff:rules:capitalisation.functions]
extended_capitalisation_policy = upper

[sqlfluff:rules:capitalisation.literals]
extended_capitalisation_policy = upper

[sqlfluff:rules:convention.count_rows]
prefer_count_1 = True

@louisjoecodes
Copy link
Contributor

louisjoecodes commented May 24, 2024

Hey @ikhudur, unfortunately sqruff doesn't support dbt. Definitely might be worth checking out what we are building over at https://github.com/quarylabs/quary 😊

We're happy to consider adding dbt support in the future - feel free to reach out if you want to contribute.

@alxsbn
Copy link

alxsbn commented Jun 5, 2024

@louisjoecodes It's a must have I think :)

@catkins
Copy link

catkins commented Jul 29, 2024

ah, just ran into this too - yeah +1 for dbt support!

@benfdking benfdking changed the title Getting Error "not implemented" when running sqruff lint DBT support Aug 8, 2024
@benfdking benfdking added the enhancement New feature or request label Aug 8, 2024
@benfdking
Copy link
Collaborator

https://x.com/BenFKing/status/1821546414763327796 We're trying to find a way that is fair and just.

@segoldma
Copy link

+1!

@jordandakota
Copy link

It works perfectly fine with dbt but for the {{. I can't find a way to avoid adding a space between the brackets without just disabling the rule.

@benfdking
Copy link
Collaborator

https://github.com/quarylabs/sqruff/pulls#:~:text=feat%3A%20implementing%20jinja%20templater just fortracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants