Git Product home page Git Product logo

Comments (7)

RobertOstermann avatar RobertOstermann commented on July 2, 2024 2

Yeah, that doesn't surprise me, but I had hoped maybe that setting would work. I should have some free time in the next week or two to figure out if I can get the extension to work with the dbt templater.

from vscode-sqlfluff-extended.

RobertOstermann avatar RobertOstermann commented on July 2, 2024

Yeah, I'm not sure that the dbt templater will work at all for this extension either. Does the formatting also not work? And if formatting does not work, could you try setting sqlfluff.experimental.format.executeInTerminal = true and attempt to format the document again? This setting still has some known bugs, but it runs the sqlfluff command directly on the file instead of passing the text through stdin, which from the other issue sounds like the source of the problem.

from vscode-sqlfluff-extended.

reegs avatar reegs commented on July 2, 2024

Thanks for the reply Robert, for the moment the formatting of the document also doesn't work via the extension even when I set sqlfluff.experimental.format.executeInTerminal = true as you suggested. VS Code will give me a progress bar moving across the top of the editor window, which to me indicates that it's doing something, but it doesn't format the document or provide linting problems.

from vscode-sqlfluff-extended.

RobertOstermann avatar RobertOstermann commented on July 2, 2024

@reegs Do you get the correct linting problems when you run the sqlfluff lint {path} command from the command line? And what happens when you run sqlfluff fix {path} from the command line?

from vscode-sqlfluff-extended.

RobertOstermann avatar RobertOstermann commented on July 2, 2024

Could you also attempt the latest version, currently v0.2.7, and let me know if the linting works for you in that version.

from vscode-sqlfluff-extended.

RobertOstermann avatar RobertOstermann commented on July 2, 2024

One other thing to note, the linting currently only works when the setting sqlfluff.linter.run is set to onSave

from vscode-sqlfluff-extended.

ingo-m avatar ingo-m commented on July 2, 2024

I first also thought there was a problem with vscode-sqlfluff-extended.

With this config

[sqlfluff]
templater = dbt

I get "SQLFluff Formatting Failed." But when I ran sqlfluff lint {path} and sqlfluff fix {path}, I noticed that the problem was due to dbt, not vscode-sqlfluff-extended.

I think ultimately sqlfluff in combination with dbt is prone to fail. The entire complex linting, including dbt references / model dependencies / etc. belongs into a CI/CD pipeline. It would be great if there was an easy to use auto-formatter plugin for vscode (like black code style plugins for python), but sqlfluff might not be able to deliver that (if the code contains dbt specific syntax).

from vscode-sqlfluff-extended.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.