Git Product home page Git Product logo

vscode-sqlfluff's Introduction

SQLFluff

The SQL Linter for Humans

PyPi Version PyPi License PyPi Python Versions PyPi Status PyPi Downloads

Coveralls GitHub Workflow Status ReadTheDocs Code style: black Docker Pulls

SQLFluff is a dialect-flexible and configurable SQL linter. Designed with ELT applications in mind, SQLFluff also works with Jinja templating and dbt. SQLFluff will auto-fix most linting errors, allowing you to focus your time on what matters.

Dialects Supported

Although SQL is reasonably consistent in its implementations, there are several different dialects available with variations of syntax and grammar. SQLFluff currently supports the following SQL dialects (though perhaps not in full):

We aim to make it easy to expand on the support of these dialects and also add other, currently unsupported, dialects. Please raise issues (or upvote any existing issues) to let us know of demand for missing support.

Pull requests from those that know the missing syntax or dialects are especially welcomed and are the question way for you to get support added. We are happy to work with any potential contributors on this to help them add this support. Please raise an issue first for any large feature change to ensure it is a good fit for this project before spending time on this work.

Templates Supported

SQL itself does not lend itself well to modularity, so to introduce some flexibility and reusability it is often templated as discussed more in our modularity documentation.

SQLFluff supports the following templates:

Again, please raise issues if you wish to support more templating languages/syntaxes.

VS Code Extension

We also have a VS Code extension:

Getting Started

To get started, install the package and run sqlfluff lint or sqlfluff fix.

$ pip install sqlfluff
$ echo "  SELECT a  +  b FROM tbl;  " > test.sql
$ sqlfluff lint test.sql --dialect ansi
== [test.sql] FAIL
L:   1 | P:   1 | LT01 | Expected only single space before 'SELECT' keyword.
                       | Found '  '. [layout.spacing]
L:   1 | P:   1 | LT02 | First line should not be indented.
                       | [layout.indent]
L:   1 | P:   1 | LT13 | Files must not begin with newlines or whitespace.
                       | [layout.start_of_file]
L:   1 | P:  11 | LT01 | Expected only single space before binary operator '+'.
                       | Found '  '. [layout.spacing]
L:   1 | P:  14 | LT01 | Expected only single space before naked identifier.
                       | Found '  '. [layout.spacing]
L:   1 | P:  27 | LT01 | Unnecessary trailing whitespace at end of file.
                       | [layout.spacing]
L:   1 | P:  27 | LT12 | Files must end with a single trailing newline.
                       | [layout.end_of_file]
All Finished ๐Ÿ“œ ๐ŸŽ‰!

Alternatively, you can use the Official SQLFluff Docker Image or have a play using SQLFluff online.

For full CLI usage and rules reference, see the SQLFluff docs.

Documentation

For full documentation visit docs.sqlfluff.com. This documentation is generated from this repository so please raise issues or pull requests for any additions, corrections, or clarifications.

Releases

SQLFluff adheres to Semantic Versioning, so breaking changes should be restricted to major versions releases. Some elements (such as the python API) are in a less stable state and may see more significant changes more often. For details on breaking changes and how to migrate between versions, see our release notes. See the changelog for more details. If you would like to join in, please consider contributing.

New releases are made monthly. For more information, visit Releases.

SQLFluff on Slack

We have a fast-growing community on Slack, come and join us!

SQLFluff on Twitter

Follow us on Twitter @SQLFluff for announcements and other related posts.

Contributing

We are grateful to all our contributors. There is a lot to do in this project, and we are just getting started.

If you want to understand more about the architecture of SQLFluff, you can find more here.

If you would like to contribute, check out the open issues on GitHub. You can also see the guide to contributing.

Sponsors

Datacoves
The turnkey analytics stack, find out more at Datacoves.com.

vscode-sqlfluff's People

Contributors

alex-mirkin avatar bantonellini avatar barrywhart avatar dependabot[bot] avatar dorzey avatar emekdahl avatar frederikaalund avatar itsvipa avatar jice-lavocat avatar keraion avatar mhahn-ts avatar noel avatar pdecat avatar qbatten avatar rene-haskia avatar robertostermann avatar rubensa avatar ssassi avatar yaegassy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-sqlfluff's Issues

Change the severity of the linting issues.

Currently, the severity of the SQLfluff linting issues are at the severity level Error this seems to be hardcoded here. However, these linting issues are very unlikely to actually be an error. Instead, this should probably be hint or warning. It would be great if you were able to select this in the settings.

Settings: `executablePath` does not support VSCode variables

Problem
executablePath config does not support VSCode variables. (List of VSCode config variables)

Steps to replicate
Assumption: ${workspaceFolder} is set to /User/<user>/code for this project.

  1. Launch VSCode, install SQLFluff plugin.
  2. Edit VSCode settings
  3. Set sqlfluff.executablePath to full path to a SQLFluff executable. (See below)
    • Example: "sqlfluff.executablePath": "/Users/<user>/code/.venv/bin/sqlfluff"
  4. Verify that SQLFluff is able to run.
  5. Update sqlfluff.executablePath to reference ${workspaceFolder} instead of having a full path.
    • Example: "sqlfluff.executablePath": "${workspaceFolder}/.venv/bin/sqlfluff"

Expected
SQLFluff continues to work.

Actual
SQLFluff fails to lint, due to executable path is not found.

When templater = "dbt" extension does not work

When templater = "dbt" no linting occurs and Format Document shows the "SQLFluff is formatting the file" popup but nothing happens.

When templater = "jinja" it works.

sqlfluff 0.8.1
sqlfluff-templater-dbt 0.8.1

Linting all files consumes too much CPU

Hello, thanks for the extension! Unfortunately, as of v0.1.6, my computer has been pegged at 100% CPU because it wants to lint all my files, and since I am working on a large project (about 15 MB of SQL, 200k+ lines of code), this takes a very, very long time to run and brings my computer grinding to a halt.

Please could an option to disable this feature be added as a hotfix? After that, please consider adding the ability to configure the CPU-hungriness of this task when it is enabled, e.g. by assigning a maximum numbers of CPU cores, maximum number of concurrent sqlfluff processes, a process "niceness" level, etc.

Additionally, I have noticed that some sqlfluff processes linger even after VSCode has been quit.

System info:

  • OS: macOS 10.15.7
  • VSCode version: 1.72.2 (commit d045a5eda657f4d7b676dedbfa7aab8207f8a075)
  • vscode-sqlfluff version: 0.1.7

The argument 'file' cannot be empty. Received ''

Description:

Sqlfluff works in the CLI.
In VSCode, I have the 'onSave' trigger (because I'm using templater: dbt). When I look in the Dev Console, I get a warning message about having an empty file argument. My intuition is that this is related to some new settings that I haven't well configured, but I can't find which one.

Using:

  • dbt: 1.3.1
  • dbt-bigquery: 1.3.0
  • sqlfluff: 1.4.2
  • vscode-sqlfluff: 2.2.0

Stack trace:

TypeError: The argument 'file' cannot be empty. Received ''
	at new NodeError (node:internal/errors:371:5)
	at normalizeSpawnArguments (node:child_process:517:11)
	at Object.spawn (node:child_process:713:13)
	at vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:14:140
	at new Promise (<anonymous>)
	at SQLFluff.run (vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:8:57)
	at C1.doLint (vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:18:3852)
	at vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:18:3305
	at pe.queue (vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:18:737)
	at y1.<anonymous> (vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:18:1630)
	at vscode-file://vscode-app/Users/jice_lavocat/.vscode/extensions/dorzey.vscode-sqlfluff-2.2.0/out/src/extension.js:18:1151

executablePath seems to have no effect

i have sqlfluff installed in a virtualenv. I tried setting sql.linter.executablePath to the virtualenv location (I am pretty certain is correct) but the extension says "The executable was not found". after installing sqlfluff globally, then the extension works (whether I set executablePath or not). this leads me to think that the executablePath configuration field is not correctly taken into consideration

if executing in terminal, vscode extension pop up "SQLFluff Formatting Failed" even if it formats successfully

If turn of executeInTerminal option (for dbt templating), it pop up "SQLFluff Formatting Failed" sometimes even it formatted successfully.

I tested and found it's because of this line https://github.com/sqlfluff/vscode-sqlfluff/blob/master/src/features/formatter/formattingProvider.ts#:~:text=cp.execSync(command%2C%20options)%3B

In fact, when doing fix, sqlfluff will return 0, if the formatting is done and no more linting violations, and return 1 when the formatting is done and still have unfixable violations.

chuxi@LAPTOP:~/test$ sqlfluff fix --force test25.sql --dialect snowflake
==== finding fixable violations ====
== [test25.sql] FAIL
L:   6 | P:   1 | L051 | Join clauses should be fully qualified.
L:   8 | P:  44 | L014 | Unquoted identifiers must be consistently pascal case.
L:   8 | P:  74 | L011 | Implicit/explicit aliasing of table.
L:   8 | P:  74 | L025 | Alias 'PayLoadFlatten' is never used in SELECT
                       | statement.
L:   8 | P:  88 | L016 | Line is too long.
L:   9 | P:  22 | L014 | Unquoted identifiers must be consistently pascal case.
L:   9 | P: 107 | L016 | Line is too long.
L:  10 | P:   1 | L003 | Expected 1 indentations, found 0 [compared to line 09]
L:  11 | P:  12 | L008 | Commas should be followed by a single whitespace unless
                       | followed by a comment.
L:  11 | P:  13 | L009 | Files must end with a single trailing newline.
==== fixing violations ====
10 fixable linting violations found
FORCE MODE: Attempting fixes...
Persisting Changes...
== [test25.sql] PASS
Done. Please check your files to confirm.
  [6 unfixable linting violations found]
chuxi@LAPTOP:~/test$ echo $?
1

So when sqlfluff exit with 1, it's still acceptable but child_process.execSync will raise exception with any non-zero exit code.

I think we can change child_process.execSync to child_process.spawnSync and use the exit code to give different warnings

Extension ignores settings, fixed file is marked as unsaved and parses twice, parsed content is pasted into a currently opened tab instead of the original file

Hi!

I have set my VSCode to save files on focus change.
Extension is set to lint and fix files onSave by default. When I switch tabs, it is pasting the linted content into my new tab instead of the source file it was taken from.

I tried setting the automatic option to 'off', but it is ignored by the extension. Also, when I save the file manually, it's marked as unsaved even after nothing is changed by linter, so switching tabs saves it again and runs linting/fixing again.

Here's a video presenting the problem. Note that I pressed ctrl+z in the settings.json to restore original content (keystrokes not visible on video):

2021-10-22.14-29-39.mp4

.sqlfluff config file location

Hi!

This is more of a question than an issue. According to SQLFLuff documentation, there are several places where SQLFLuff will look for config files. One of them is "It will look for the same files in every subdirectory between the current working dir and the file directory".

Now, I can't figure out what my current working directory is when using the sqlfluff extension. I have changed the cwd of VSCode's Terminal (like this "terminal.integrated.cwd": "/Users/PargAsh/Work") but it doesn't lint according to a config file placed between that directory and the directory of the file being linted. So maybe the VSCode Terminal's cwd is not the same as the SQLFLuff extension's cwd?

There is a specific setting for Python linting ("python.linting.cwd": "") but not for SQLFluff as far as I know.

I would appreciate any help!

Doesn't seem to pick up settings in my .sqlfluff settings

Unrelated (but related): One thing that I noticed in the past is that the extension doesn't seem to pick up settings in my .sqlfluff settings file saved to the root of my repo. Not a change per se from prior versions, but I would love to see if we/I can debug this so I can override the default formatting and apply my team's agreed-upon format rules.

Originally posted by @aaronsteers in #9 (comment)

Feature request: vscode Actions

There are two scenario's where the use of vscode actions are extremely usefull:

  1. Running sqlfluff agains the entire project and registering the issues in vscode such that they are shown in the problems tab
    image
  2. Running sqlfluff fix against the current file, currently there is the option to enable it automatically, but this can result in issues when you keep typing. Therefore, it is probably bad practice to keep that option enabled which, in turn, calls for another well-integrated option to run fix from within vscode.

Linter Does not Respect .sqlfluff Configs / `templater=dbt`

Hi,

I can't seem to make the linter respect a .sqlfluff file present in my project. The "problems" section is obviously generated using the stock SQLFluff configs: the output does not match at all with the CLI output from running sqlfluff lint <model_path>.

I'm not super familiar with Typescript or VS code extensions but I'd be happy to troubleshoot if anyone can show me in the code where the sqlfluff command is being run, (i.e. from where) and how the output is being loaded into a class.

Thanks,

Teghan

Add extension to Open VSX

Some of us use alternatives to VS Code. (I use VSCodium myself.) These don't have access to Microsoft's Visual Studio Marketplace. Of course we can download the vsix file from here and install it. But I feel that adding your extension to the open marketplace, Open VSX, will help you reach more coders.

Add quick fix for dbt rule L016 "line is too long" - add `-- noqa: L016` at EOL

If formatter is DBT, then, sometimes code creates too long lines that cannot be split. But it violates rule L016.
This is the use case for -- noqa: L016 => suggest it as a quick fix in cases when this rule is violated.

Maybe: adding this quick fix prompt to all DBT rule violations
Cons:

  • end users may start to abuse this new freedom and noqa everything
  • not all DBT rules are fixable by noqa, e.g. L044 "Somewhere along the โ€œpathโ€ to the source data, specify columns explicitly"

Formatter breaks files in case of errors when autoformatting

Using this extension as a formatter at the moment is rather dangerous as it can break the files.

Assuming a non-autofixable error occurs, it'll prefix this error at the beginning.

I think this error should instead be shown differently (maybe as popup) or in the problems zone - but currently, it's adding the error line at the beginning of the SQL file - which will obviously break the subsequent run of dbt (or whatever else).

Usually, the error can be fixed by manually formatting the problematic part and removing the warning from the top - but UX / DX in this case is pretty bad.

Example output:

WARNING    One fix for L003 not applied, it would re-cause the same error. 

SELECT
...

Running SQLFluff in the command line against that file will also cause this error - but it will not write the error to file

==== finding fixable violations ====
WARNING    One fix for L003 not applied, it would re-cause the same error.
...

cannot find sqlFluff Executable -- Windows + virtual environment issue?

I'm having trouble getting the extension to "find" my version of sqlfluff. I'm using Windows 10, pipenv for virtual environment management, and below is some info that might shed light on the issue?

pipenv --py

C:\Users[USER].virtualenvs[PROJNAME]-cP1ijf-7\Scripts\python.exe

pipenv shell
sqlfluff --version

sqlfluff, version 0.3.5
settings.json in VS Code contains:

"sql.linter.executablePath":
"C:\\Users\\[USER]\\.virtualenvs\\[PROJECT]-cP1ijf-7\\Scripts\\sqlfluff.exe",

When I open a SQL file in VS Code, I get the following error message:

The executable was not found, Use the 'sql,jinja-sql.executablePath' setting to configure the location of the executable.

When I copy the sqlfluff.exe file directly into the main project I'm in, the extension works like a charm.

Unable to run format due to missing flag

When trying to format some documents the extension provides two error boxes:

  1. SQLFluff templating/parsing errors found
  2. Fix aborted due to unparseable template variables. Use --FIX-EVEN-UNPARSABLE' to attempt to fix the SQL anyway

I am currently using it with the dialect redshift and Linter:Run onType, I think that's all the changes I have in the config.

Is there a way to add the flag in the settings json? I haven't found any in the docs.

Can't call wrapper script for sqlfluff

Hi,

First, thanks for the nice plugin!

I'm trying to use a wrapper powershell script that calls sqlfluff instead of calling it directly, but I can't get it to work.
(The main reason for using a wrapper is that I would to make sure the user has the same version of sqlfluff installed as the CI/CD pipeline)

As a minimal example I tried this:

  1. I made a simple wrapper script bin\sqlfluff.ps1 that does just this:
sqlfluff $args

(I tried with @args too)

  1. When I call the script from the terminal, it seems to work as expected.
  2. When I set the plugin's "Executable Path" to "sqlfluff", the plugin works fine.
  3. When I set "Executable Path" to "bin\does_not_exists.ps1", I get an "executable not found" error message.
  4. When I set "Executable Path" to "bin\sqlfluff.ps1", I don't get that message, but the plugin does not seem to work. Nothing happen, reformating files has no effect, etc.

I could not find any log or error message, and I have no idea what is wrong with my script (I'm more a bash person than powershell).

Help would be greatly appreciated.

DBT project in sub-folder

Hi,

First of all, thank you for creating this amazing extension. I have discovered a potential bug, or perhaps at least something that could be documented better.

My folder structure looks like this:

vscode_workspace_folder
โ”œโ”€โ”€ dax_code
โ”œโ”€โ”€ dbt_model
โ”‚ย ย  โ”œโ”€โ”€ analysis
โ”‚ย ย  โ”œโ”€โ”€ data
โ”‚ย ย  โ”œโ”€โ”€ dbt_modules
โ”‚ย ย  โ”œโ”€โ”€ logs
โ”‚ย ย  โ”œโ”€โ”€ macros
โ”‚ย ย  โ”œโ”€โ”€ models
โ”‚ย ย  โ”œโ”€โ”€ snapshots
โ”‚ย ย  โ”œโ”€โ”€ target
โ”œโ”€โ”€ erd_diagrams
โ”œโ”€โ”€ sql_functions
โ””โ”€โ”€ tmp

I am opening vscode_workspace_folder as my workspace folder in vscode, but my DBT folder is in a sub-folder. This causes sqlfluff to not work on sql files that contain custom macros.

There is no error or logging anywhere, it just doesn't work.

Through trial and error I have narrowed it down to jinja-SQL files that are using custom macros.

And when I open the DBT folder directly, then everything works. It picks up my sqlfuff file and uses the DBT templater to do the linting as expected.

Greetings, kim

Runtime errors in VSCode

Hi,

I'm running this extension in VSCode together with Dev containers extension (see: https://code.visualstudio.com/docs/remote/containers).

The configuration I have for this extension is:

{ "terminal.integrated.defaultProfile.linux#": "/bin/bash", "python.pythonPath": "/usr/local/bin/python", "files.associations": { "*.sql": "jinja-sql" }, "sql.format.enable": false, "sqlfluff.config": "${workspaceFolder}/.sqlfluff", "sqlfluff.dialect": "snowflake", "sqlfluff.executablePath": "/usr/local/bin/sqlfluff", "sqlfluff.format.enabled": true, "sqlfluff.format.workingDirectory": "", "sqlfluff.ignoreLocalConfig": false, "sqlfluff.ignoreParsing": true, "sqlfluff.linter.run": "onSave", "sqlfluff.experimental.format.executeInTerminal": false, "editor.formatOnSave": false, "[sql]": { "editor.defaultFormatter": "dorzey.vscode-sqlfluff" } }

Whenever I try to format a SQL file I get:
WARNING File /dbt/stdin was not found in dbt project

And then this code gets added to the beginning of the SQL file:
๏ฟฝ[0m16:32:27 [๏ฟฝ[33mWARNING๏ฟฝ[0m]: Deprecated functionality The source-pathsconfig has been renamed tomodel-paths. Please update your dbt_project.ymlconfiguration to reflect this change. ๏ฟฝ[0m16:32:27 [๏ฟฝ[33mWARNING๏ฟฝ[0m]: Deprecated functionality Thedata-pathsconfig has been renamed toseed-paths. Please update your dbt_project.yml configuration to reflect this change.

Traceback


File "/opt/homebrew/bin/sqlfluff", line 8, in <module>     sys.exit(cli())   File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1130, in __call__     return self.main(*args, **kwargs)   File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1055, in main     rv = self.invoke(ctx)   File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1657, in invoke     return _process_result(sub_ctx.command.invoke(sub_ctx))   File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1404, in invoke     return ctx.invoke(self.callback, **ctx.params)   File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 760, in invoke     return __callback(*args, **kwargs)   File "/opt/homebrew/lib/python3.10/site-packages/sqlfluff/cli/commands.py", line 549, in lint     config = get_config(   File "/opt/homebrew/lib/python3.10/site-packages/sqlfluff/cli/commands.py", line 361, in get_config     r

sqlfluff version : 1.3.2
os:mac

Allow sqlfluff to be installed in a conda (or other) virtual environment

Issue:
As alluded to by @pwildenhain in this slack thread, it seems this extension only works if sqlfluff is installed globally. It does not seem to recognize sqlfluff when it is installed in a virtual environment.

I have sqlfluff installed in a conda virtual environment and I donโ€™t get ANY feedback in VScode that the sqlfluff extension is working even though the extension is installed and enabled. I see no linting hints like in the demo shown in this repo. I am able to run sqlfluff from the terminal so I do know it is installed and works.

โ–ถ sqlfluff lint models/analytics/editorial/sl_web_editorial_time_on_page.sql                                                                                           
== [models/analytics/editorial/sl_web_editorial_time_on_page.sql] FAIL
L:  35 | P:   7 | L003 | Indentation not hanging or a multiple of 4 spaces
L:  37 | P:   5 | L003 | Indent expected and not found compared to line #34
L:  39 | P:   7 | L003 | Indentation not hanging or a multiple of 4 spaces
L:  39 | P: 113 | L016 | Line is too long

I have python, dbt, and sqlfluff installed via a conda virtual environment (and virtual env is activated in VScode). The conda env is defined as:

name: surfline-dbt-dev
channels:
  - conda-forge
  - defaults
dependencies:
  - pip=20.1.1
  - python=3.7.3
  - pip:
    - dbt==0.19.0
    - sqlfluff[dbt]

Path to sqlfluff is

โ–ถ which sqlfluff                                                                                                                                                    
/opt/anaconda3/envs/surfline-dbt-dev/bin/sqlfluff

I have the path to sqlfluff specified in my VScode settings.json like:

    "sql.linter.executablePath": "/opt/anaconda3/envs/surfline-dbt-dev/bin/sqlfluff",
    "sql.linter.run": "onType",

Expected Behavior:
sqlfluff extension should be able to use sqlfluff from the conda environment, or any other virtual environment that is active in VScode.

Possible Solutions:
While I am not familiar with the code structure for VScode extensions, I do know that the dbt Power user VSCode extension is able to recognize dbt when it is installed in a conda environment. Maybe a similar approach could be used here? It looks like the important files for recognizing the virtual environment are listed here: https://github.com/innoverio/vscode-dbt-power-user/search?q=environment

Lint entire project ignores .sqlfluffignore

Hรฉ @RobertOstermann

The quick addition to this plugin where there is now a "lint entire project" action was great. There is one issue now however. It also tries to lint the files that are ignored via the .sqlfluffignore file. This currently means that when I run this action in my DBT project I get an almost unending list of warnings that the <file that is ignored in .sqlfluff> is not a dbt model. In fact I get so many warnings that vscode just straight up crashes...

Diagnostic severity as "warning" for linting rules and "error" for parsing errors

Would be nice to see yellow squigly lines for linting rule violations and red squigly lines for parsing errors by default. The only way I can currently make this work is by defining the diagnostic severity for each rule seperately in the settings, like:

"sqlfluff.linter.diagnosticSeverityByRule": [
        {
          "rule": "L001",
          "severity": "warning"
        },
        {
          "rule": "L002",
          "severity": "warning"
        },
       etc..........
      ],

Each rule has a group tag, see: https://docs.sqlfluff.com/en/stable/rules.html#module-sqlfluff.rules
Maybe we can somehow use the tag: "all"?

BUG: The executable was not found. Use the 'sql,jinja-sql.executablePath' ...

This bug was surfed in the sqlfluff slack:

Cannot lint /jaffle_shop_mssql/models/staging/stg_orders.sql. The executable was not found. Use the 'sql,jinja-sql.executablePath' setting to configure the location of the executable

Several things are odd here:

  1. What kind of config is sql,jinja-sql.executablePath?
  2. Isn't sql.linter.executablePath the relevant config?

I searched around the repo to try and find where sql,jinja-sql.executablePath might be raised, but no dice. Help me dorzey!

Add VS Code Extensions search optimization for "DBT" keyword

@dorzey - I love what we can do now with this extension - especially with the upcoming VS Code formatter support (again thank you! for that) and I want to help get the word out. One thing I noticed is that this doesn't show up in a search for "DBT" and I think it should - not that it is exclusively for dbt but so much of the community and even the evolution of the sqlfluff product has been for DBT use cases.

Do you have any thoughts on this? I know exactly zero about what control we have over surfacing results in the VS Code extensions view, but from my perhaps naรฏve perspective, I would be supportive of one or more of the below:

  1. Extending the short text description to include "DBT".
    • from An extension to use the sqlfluff linter in vscode
    • to something like A VS Code linter and auto-formatter for sqlfluff, a popular and powerful linting tool for SQL and DBT.
  2. Extending the README.md description (assuming this also helps it appear in dbt search results.)
    • possibly add something in the readme like
    • to something like

      SQLFluff also has first-class support for jinja2 templating, including support for DBT templating.

However you would want to present it, I think it's worth pitching the power of SQLFluff and its compatibility with DBT.

Here's what currently shows on a search for dbt:

image

The DBT formatter that shows there in the list is not nearly as powerful or customizable as SQLFluff. While it was probably the first offering out there, it has its own issues and I wouldn't necessarily recommend that formatter for my teams.

Part of goal with logging this issue is to make sure new and existing DBT users know they have this extension as a better option (IMHO) for their DBT projects.

Linter ignores rule that works in formatter

Hi!

I have rule L019 set to leading commas. The formatter perfectly follows the rule and puts all commas in front. The linter however subsequently marks these as errors. All other rules seem to be interpreted correctly.

"Found leading comma. Expected only trailing.sqlfluff(L019)"

image

If I use the CLI command to lint the same file, there is no L019 warning and everything works perfectly.

I'm using the latest versions of SQLFluff as well as the extension. This is with templater = dbt and dialect = bigquery.

Support native VS Code "format" capability to run "fix" in SQLFLuff

Hello!

Would it be possible to add autoformat (aka 'fix') support to this extension? I've created a hacky workaround (which I'll describe below), but native support would be so much more intuitive, powerful, and stable.


Workaround

  1. Install the Run on Save extension by emeraldwalk.

  2. Add the snippet to .vscode/settings.json:

{
    "emeraldwalk.runonsave": {
        "commands": [{
            "match": "\\.sql$",
            "cmd": "sqlfluff fix ${file} --force --rules L003,L009,L010,L011,L016,L30 --dialect snowflake"
        }]
    }
}

Caveats/issues that would be resolved by native format (fix) support:

  • You have to disable any competing "format on save" options for sql files.
  • Because saving happens in the background, there's a delay between saving and refresh. Occasionally you will receive "file modified externally" conflicts and be prompted to refresh and lose all changes or "overwrite" the external changes.
  • You could use explicit "format" option in VS Code natively and on-demand.
  • You can optionally enable "format on save" native option in VS Code.

Lastly, thanks so much for creating this extension. Having SQLFluff support in VS Code has been a gamechanger for our data team.

Support --exclude-rules --rules argument

Thanks for creating this plugin. Is it possible to add a configuration allows user to only use a subset of rules? (--exclude-rules or --rules)

sqlfluff fix --exclude-rules L036 file.sql

Joining sqlfluff org

๐Ÿ‘‹ Hello there!

First off, great plugin ๐Ÿ’ฏ ๐Ÿ”Œ ๐Ÿ’– I use it daily ๐Ÿ™‡โ€โ™‚๏ธ

@alanmcruickshank recently transferred the sqlfluff project to it's own github org, and has started adding members who are interested in the project's continued success. We're also trying to gauge interest in moving related repos under the same org, as @nolanbconaway did with his online sqlfluff formatter

Two questions for you:

  1. Would you be interested in joining the sqlfluff org?
  2. Would you be interested in moving this repo under the sqlfluff org? (while retaining the same rights ๐Ÿ” )

Unrecoverable failure in Jinja templating

Hi there, I'm not being able to lint a bunch of dbt SQL files. The error I get is:

L:   1 | P:   1 |  TMP | Unrecoverable failure in Jinja templating:
                       | <sqlfluff.core.templaters.jinja.JinjaTemplater.process.<locals>.Undefined
                       | object at 0x1051cbd60> is not safely callable. Have you
                       | configured your variables?
                       | https://docs.sqlfluff.com/en/latest/configuration.html

Below one of the scripts where this is happening:

{%- set stuck_rows_in_a_row = 3 -%}
{%- set fcs_criteria_in_seconds = 30 -%}
{%- set low_fps = 20 -%}

WITH recording_started AS(SELECT * FROM {{ ref('fct_recording_started')}} WHERE NOT COALESCE(is_test_user, FALSE))

, recordings_stopped AS (SELECT * FROM {{ ref('fct_recording_stopped') }})

, archives AS(
    SELECT 
        rso.archive_id,
        rsa.session_id,
        rso.stream_id,
        rso.recording_id,
        rso.studio_id,
        rso.recording_stopped_reason,
        rso.user_id IS NOT NULL AS is_user,
        rso.expected_duration_in_seconds,
        rsa.server_timestamp,
        rsa.recorder_version,
        rsa.audio_input_media_device_label,
        rsa.video_input_media_device_label,
        rsa.user_id,
        rsa.is_test_user,
        rsa.anonymous_id,
        rsa.studio_role,
        rsa.studio_owner_id,
        rsa.studio_owner_email,
        COALESCE(rsa.recording_type, rso.recording_type) AS recording_type,
        COALESCE(rsa.live_call_id, rso.live_call_id) AS live_call_id,
        COALESCE(rsa.client_id, rso.client_id) AS client_id,
        rsa.timestamp AS recording_started_timestamp,
        rso.timestamp AS recording_stopped_timestamp,
        rso.uploaded_at AS batch
    FROM recording_started rsa
    JOIN recordings_stopped rso 
        ON rsa.archive_id = rso.archive_id
    WHERE rsa.source = 'new'
    )

, waiting_room AS(
    SELECT
        arc.archive_id,
        count(jwr.client_id) AS number_participants_in_waiting_room_during_recording
    FROM {{ ref('fct_joined_waiting_room') }} jwr
    JOIN archives arc
        ON arc.studio_id = jwr.studio_id
            AND jwr.timestamp BETWEEN arc.recording_started_timestamp AND arc.recording_stopped_timestamp
    WHERE jwr.studio_recording_status = 'recording'
    GROUP BY 1
)

, max_upload_progress AS(
    SELECT 
        archive_id,
        MAX(upload_progress_uploaded_bytes) AS max_upload_progress_uploaded_bytes 
    FROM {{ ref('fct_recording_progression_stream') }}
    GROUP BY 1
)

, sync_issues AS(
    SELECT 
        s.archive_id,
        upload_progress_uploaded_bytes,
        CASE
        WHEN upload_progress_uploaded_bytes = 0 THEN 'beginning'
        WHEN upload_progress_uploaded_bytes = max_upload_progress_uploaded_bytes  THEN 'end'
        ELSE 'middle' END AS moment_flag,
        COUNT(1) AS n_rows,
        DATEDIFF('minute', MIN(timestamp), MAX(timestamp)) AS range_in_minutes
     FROM {{ ref('fct_recording_progression_stream') }} s
     LEFT JOIN max_upload_progress s2 ON s.archive_id = s2.archive_id
     GROUP BY 1, 2, 3
     HAVING n_rows >= {{ stuck_rows_in_a_row }}
        AND range_in_minutes >= {{ stuck_rows_in_a_row }}
)

, sync_issues_pivoted AS(
    SELECT 
        archive_id,
        TRUE AS stuck, -- single value, any agg is ok
        BOOLOR_AGG(moment_flag='beginning') AS stuck_at_0, -- single value, any agg is ok
        BOOLOR_AGG(moment_flag='middle')  AS stuck_at_middle, -- having at least 1
        BOOLOR_AGG(moment_flag='end') AS stuck_at_end -- single value, any agg is ok
    FROM sync_issues
    GROUP BY 1
)

, streams_cadence_test AS(
    {{  test_event_cadence(
        model= ref('fct_recording_progression_stream'),
        grouping_column='archive_id', time_column='timestamp',
        date_part='minute', threshold=1) }}
)

, rec_prog_stream AS(
    SELECT  
        rps.archive_id,
        COUNT(DISTINCT rps.archive_id || rps.timestamp) AS stream_count,
        BOOLOR_AGG(NULLIF(rps.frames_per_second, 0) < {{ low_fps }} ) AS any_stream_is_low_fps,
        BOOLAND_AGG(NULLIF(rps.frames_per_second, 0) < {{ low_fps }} ) AS all_stream_is_low_fps,
        IFF(any_stream_is_low_fps IS NOT NULL,
             DIV0(
                COUNT_IF(rps.frames_per_second < {{ low_fps }}),
                COUNT(1)
             ), NULL) AS proportion_stream_low_fps,
        IFF(any_stream_is_low_fps IS NOT NULL,
             DIV0(
                COUNT_IF(rps.frames_per_second = 0),
                COUNT(1)
             ), NULL) AS proportion_stream_fps_equal_zero,
        ANY_VALUE(recording_resolution) AS recording_resolution,
        BOOLOR_AGG(e.archive_id IS NOT NULL) AS archive_has_stream_w_cadence_problem,
        VAR_POP(upload_speed) AS var_uploading_speed,
        MIN(upload_speed) AS min_uploading_speed,
        MAX(upload_speed) AS max_uploading_speed,
        VAR_POP(download_speed) AS var_downloading_speed,
        MIN(download_speed) AS min_downloading_speed,
        MAX(download_speed) AS max_downloading_speed,
        VAR_POP(frames_per_second) AS var_frames_per_second,
        STDDEV_POP(frames_per_second) AS stddev_frames_per_second,
        MIN(frames_per_second) AS min_frames_per_second,
        AVG(frames_per_second) AS avg_frames_per_second,
        MAX(upload_progress_uploaded_bytes) AS max_upload_progress_uploaded_bytes,
        MAX(upload_progress_upload_percentage) AS max_upload_progress_upload_percentage,
        ANY_VALUE(IFNULL(stuck, FALSE)) AS got_stuck,
        ANY_VALUE(IFNULL(stuck_at_0, FALSE)) AS got_stuck_at_zero,
        ANY_VALUE(IFNULL(stuck_at_middle, FALSE)) AS got_stuck_at_middle,
        ANY_VALUE(IFNULL(stuck_at_end, FALSE)) AS got_stuck_at_end
    FROM {{ ref('fct_recording_progression_stream') }} rps
    LEFT JOIN sync_issues_pivoted sip
        ON sip.archive_id = rps.archive_id 
    LEFT JOIN streams_cadence_test e
        ON e.archive_id = rps.archive_id AND e.timestamp = rps.timestamp
    GROUP BY rps.archive_id
)

, errors_joined AS(
    SELECT 
        arc.archive_id,
        {{ pivot(
            'error_type',
            dbt_utils.get_column_values(table= ref('fct_error_notifications'), column= 'error_type'
                , where= "error_type IN ('video_muted_error', 'storage_full')"),
            agg= 'sum',
            quote_identifiers= False,
            bool= True, 
            prefix='has_'
        ) }}
    FROM {{ ref('fct_error_notifications') }} e
    JOIN archives arc
        ON e.anonymous_id = arc.anonymous_id
            AND e.timestamp BETWEEN arc.recording_started_timestamp AND arc.recording_stopped_timestamp
    GROUP BY arc.archive_id
)

, live_calls_features AS( SELECT * FROM {{ ref('live_calls_features') }})

, record_media_error AS( SELECT * FROM {{ ref('fct_record_media_error_pivoted') }})

, recordings AS (
    SELECT 
        r.*,
        a.is_enterprise -- asessing whether the studio where the recording was created belongs to a currently enterprise account
    FROM {{ ref('dim_recordings') }} r
    LEFT JOIN {{ ref('dim_studios') }} s
        ON r.studio_id = s.studio_id
    LEFT JOIN {{ ref('dim_productions') }} p
        ON s.production_id = p.production_id
    LEFT JOIN {{ ref('dim_accounts') }} a
        ON p.account_id = a.account_id
    WHERE file_type = 'local'
)

, screen_share AS (SELECT DISTINCT session_id FROM {{ ref('dim_recordings') }} WHERE source = 'mediaboard-screenshare')

, identity AS (SELECT * FROM {{ ref('segment__identity') }} )

, studios AS (SELECT * FROM {{ ref('dim_studios') }} )

, users AS (SELECT * FROM {{ ref('dim_users') }} )


, final AS(
    SELECT 
        s.archive_id,
        s.session_id,
        s.stream_id,
        s.live_call_id,
        s.recording_id,
        s.studio_id,
        s.client_id,
        s.user_id,
        s.user_id IS NOT NULL AS is_user,
        r.is_enterprise,
        s.recording_started_timestamp,
        s.recording_stopped_timestamp,
        s.recording_type,
        s.recording_stopped_reason,
        s.expected_duration_in_seconds,
        s.studio_role,
        r.duration_in_seconds,
        r.duration_in_seconds = 0 AS duration_is_zero,
        TRUNCATE(s.expected_duration_in_seconds - r.duration_in_seconds, 0) AS duration_difference,
        r.client_status,
        s.server_timestamp,
        s.recorder_version,
        SPLIT_PART(s.recorder_version, '.', 1) AS recorder_major_version,
        SPLIT_PART(s.recorder_version, '.', 2) AS recorder_minor_version,
        r.filename,
        COUNT(s.archive_id) OVER(PARTITION BY s.session_id, s.client_id) = 1 AS is_only_archive_for_client_id_in_session,
        COALESCE(lcf.mic_connected_during_recording, FALSE) AS mic_connected_during_recording,
        COALESCE(lcf.camera_connected_during_recording, FALSE) AS camera_connected_during_recording,
        COALESCE(lcf.mic_disconnected_during_recording, FALSE) AS mic_disconnected_during_recording,
        COALESCE(lcf.camera_disconnected_during_recording, FALSE) AS camera_disconnected_during_recording,
        -- ads.mic_connected_actually_set_during_recording,
        -- ads.camera_connected_actually_set_during_recording,
        lcf.number_of_initial_mics_connected,
        lcf.number_of_initial_cameras_connected,
        wr.number_participants_in_waiting_room_during_recording,
        lcf.avg_mic_latency,
        lcf.var_mic_latency,
        lcf.mic_permission_changed,
        lcf.camera_permission_changed,
        lcf.initial_echo_cancellations_settings,
        lcf.initial_operating_system AS operating_system,
        lcf.initial_browser_type_version,
        lcf.initial_graphic_card AS graphic_card,
        lcf.initial_gpu_vendor AS gpu_vendor,
        lcf.initial_device_permission_camera AS device_permission_camera,
        lcf.initial_device_permission_mic AS device_permission_mic,
        lcf.initial_hardware_concurrency AS hardware_concurrency,
        lcf.initial_device_permission_notifactions AS device_permission_notifactions,
        lcf.min_charging_level_during_recorded,
        lcf.max_charging_level_during_recorded,
        lcf.has_client_charged_during_recording,
        lcf.var_perc_storage_space_available,
        lcf.min_perc_storage_space_available,
        lcf.max_storage_used,
        lcf.min_storage_used,
        lcf.var_used_storage_space,
        lcf.var_available_storage_space,
        lcf.storage_range,
        lcf.max_storage_bins,
        lcf.min_storage_bins,
        lcf.range_storage_bins,
        lcf.initial_storage_estimate_js_storage_usage,
        lcf.initial_perc_storage_space_available,
        lcf.initial_storage_bins,
        rps.stream_count,
        rps.proportion_stream_low_fps,
        rps.proportion_stream_fps_equal_zero,
        rps.any_stream_is_low_fps,
        rps.all_stream_is_low_fps,
        rps.recording_resolution,
        rps.var_uploading_speed,
        rps.min_uploading_speed,
        rps.max_uploading_speed,
        rps.var_downloading_speed,
        rps.min_downloading_speed,
        rps.max_downloading_speed,
        rps.var_frames_per_second,
        rps.stddev_frames_per_second,
        rps.min_frames_per_second,
        rps.avg_frames_per_second,
        rps.max_upload_progress_uploaded_bytes,
        rps.max_upload_progress_upload_percentage,
        rps.got_stuck,
        rps.got_stuck_at_zero,
        rps.got_stuck_at_middle,
        rps.got_stuck_at_end,
        INITCAP(TRIM(REGEXP_REPLACE(s.audio_input_media_device_label, '\\(....:....\\)'))) AS audio_input_media_device_label,
        INITCAP(TRIM(REGEXP_REPLACE(s.video_input_media_device_label, '\\(....:....\\)'))) AS video_input_media_device_label,
        {{ star(ref('fct_record_media_error_pivoted'), relation_alias='rme', except=['archive_id'], prefix= 'media_error_') }},
        ej.has_video_muted_error,
        ej.has_storage_full AS has_storage_full_error,
        r.is_first_recording,
        r.auto_gain_control_enabled,
        r.echo_cancelation_enabled,
        r.noise_suppression_enabled,
        r.persistence,
        r.user_feature_flags_auto_adapt_encoder,
        r.user_feature_flags_auto_adapt_resolution,
        r.user_feature_flags_safe_media_stream,
        r.user_feature_flags_snapshots,
        r.user_feature_flags_web_recorder_raw_parts,
        r.user_feature_flags_single_stream,
        ss.session_id IS NOT NULL AS session_has_screen_shared,
        s.studio_owner_id,
        s.studio_owner_email,
        rps.archive_id IS NULL AS has_no_associated_recording_progression_stream_event,
        rps.archive_has_stream_w_cadence_problem AS has_stream_w_cadence_problem,
        r.archive_id IS NULL AS has_no_associated_mongo_recording,
        lcf.live_call_id IS NULL AS has_no_associated_live_call_data,
        r.duration_in_seconds AS recording_duration_in_seconds,
        r.shift_estimation,
        r.git_version_tag,
        HOUR(s.recording_started_timestamp) AS recording_started_hour_of_the_day,
        ABS(TRUNCATE(s.expected_duration_in_seconds - r.duration_in_seconds, 0)) AS abs_duration_diff,
        CASE
            WHEN abs_duration_diff < 2 THEN 'A. <2 Seconds'
            WHEN abs_duration_diff <= 5 THEN 'B. 2-5 Seconds'
            WHEN abs_duration_diff <= 10 THEN 'C. 6-10 Seconds'
            WHEN abs_duration_diff <= 30 THEN 'D. 11-30 Seconds'
            WHEN abs_duration_diff <= 60 THEN 'E. 31-60 Seconds'
            WHEN abs_duration_diff < 60*3 THEN 'F. 1-2 Minutes'
            WHEN abs_duration_diff < 60*6 THEN 'G. 3-5 Minutes'
            WHEN abs_duration_diff < 60*11 THEN 'H. 6-10 Minutes'
            WHEN abs_duration_diff < 60*31 THEN 'I. 11-30 Minutes'
            WHEN abs_duration_diff < 60*61 THEN 'J. 31-60 Minutes'
            ELSE 'K. >60 Minutes'
        END AS time_difference_bucket,
        (abs_duration_diff > {{ fcs_criteria_in_seconds }}) AND NOT duration_is_zero AS file_cut_short,
        BOOLOR_AGG((client_status = 'uploaded' OR client_status IS NULL) AND file_cut_short) OVER(PARTITION BY s.session_id) AS session_has_file_cut_short,
        CASE
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 0 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Sun 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 0 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Sun 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 0 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Sun 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 0 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Sun 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 1 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Mon 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 1 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12  THEN 'Mon 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 1 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Mon 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 1 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Mon 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 2 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Tue 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 2 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Tue 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 2 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Tue 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 2 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Tue 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 3 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Wed 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 3 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Wed 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 3 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Wed 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 3 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Wed 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 4 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Thu 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 4 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Thu 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 4 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Thu 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 4 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Thu 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 5 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Fri 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 5 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Fri 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 5 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Fri 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 5 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Fri 4'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 6 AND HOUR(s.recording_started_timestamp) BETWEEN 0 AND 6 THEN 'Sat 1'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 6 AND HOUR(s.recording_started_timestamp) BETWEEN 6 AND 12 THEN 'Sat 2'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 6 AND HOUR(s.recording_started_timestamp) BETWEEN 12 AND 18 THEN 'Sat 3'
            WHEN DAYOFWEEK(s.recording_started_timestamp) = 6 AND HOUR(s.recording_started_timestamp) BETWEEN 18 AND 24 THEN 'Sat 4'
            ELSE 'NA'
        END AS day_and_part_of_the_day,
        s.batch
    FROM archives s
    LEFT JOIN live_calls_features lcf
        ON s.live_call_id = lcf.live_call_id
            AND s.client_id = lcf.client_id
    LEFT JOIN waiting_room wr
        ON wr.archive_id = s.archive_id
    LEFT JOIN rec_prog_stream rps 
        ON rps.archive_id = s.archive_id
    LEFT JOIN record_media_error rme 
        ON rme.archive_id = s.archive_id
    LEFT JOIN errors_joined ej
        ON ej.archive_id = s.archive_id
    LEFT JOIN recordings r 
        ON r.archive_id = s.archive_id
    LEFT JOIN screen_share ss 
        ON ss.session_id = s.session_id
        -- WHERE (r.client_status = 'uploaded' 
        --     OR r.client_status IS NULL)
)

SELECT *
FROM final
{{  deduplicate (key='archive_id',
    time_column='recording_started_timestamp', criteria='first') }}

How to set rule in settings.json config from .vscode?

I need to set the require_final_semicolon as true for rule L052 but I need to do it in the settings.json from .vscode folder. But I don't found any schema or example about how to make to set specific rules in "sqlfluff.rules": [].

Version 0.1.6: Option to disable linting all files

Hello,
I was unaware of the change in the newest version 0.1.6 that re-lints everything in the project. In our setup we have more than 800 models already and linting all of them is not the right idea. Was there a reason to add this "feature"? Can you think of a setting that can disable this behaviour in the next versions?

Formatter overwrites my file content

Hi,

I'm using sqlfluff (0.9.1) with dbt (1.0.1). When I activate the format option in the vscode-sqlfluff extension, my model file will get overwritten by some dbt output:

13:18:09  [WARNING]: Deprecated functionality
The `source-paths` config has been renamed to `model-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.

13:18:09  [WARNING]: Deprecated functionality
The `data-paths` config has been renamed to `seed-paths`. Please update your
`dbt_project.yml` configuration to reflect this change.

When using sqlfluff from the command line (lint or fix option), I don't see this behaviour.

Issue with parameters in latest published version (v0.0.4)

Hi,

The latest version on the marketplace, v0.0,4 has an issue with the parameters. The code is looking at the parameter linter.executablePath instead of sql.linter.executablePath. So if the command sqlfluff is not in the path v0.0.4 doesn't work.

It looks like it is now fixed in master but the fix has not been pushed to a new version in the marketplace yet.

Possible bug with file not in a workspace. Silent failure, output log shows: TypeError: Cannot read properties of undefined (reading '0')

I installed sqlfluff via vscode. I have sqlfluff installed via homebrew (1.4.2).

My symptom was that there was no indication in the GUI that sqlfluff ran at all.

I tracked down some error messages in the Log (Extension Host) Output. This shows me enabling dorzey.vscode-sqlfluff. I then edited and then chose "Format Document". There is no indication that anything happened in the GUI. The log shows the error TypeError: Cannot read properties of undefined (reading '0')

2022-11-15 10:29:44.750 [info] ExtensionService#_doActivateExtension dorzey.vscode-sqlfluff, startup: false, activationEvent: 'onLanguage:sql'
2022-11-15 10:30:16.485 [error] TypeError: Cannot read properties of undefined (reading '0')
	at y1.doLint (/Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:18:3223)
	at /Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:18:3106
	at Y1.queue (/Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:18:737)
	at T1.<anonymous> (/Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:18:1630)
	at /Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:18:1151
	at runNextTicks (node:internal/process/task_queues:61:5)
	at listOnTimeout (node:internal/timers:528:9)
	at process.processTimers (node:internal/timers:502:7)
2022-11-15 10:30:19.444 [error] [dorzey.vscode-sqlfluff] provider FAILED
2022-11-15 10:30:19.444 [error] TypeError: Cannot read properties of undefined (reading '0')
	at j1.provideDocumentFormattingEdits (/Users/jlh5498/.vscode/extensions/dorzey.vscode-sqlfluff-0.1.9/out/src/extension.js:14:978)
	at B.provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:45923)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:73880
	at ne._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:67325)
	at ne.$provideDocumentFormattingEdits (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:73856)
	at l._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:13680)
	at l._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:13362)
	at l._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:12081)
	at l._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:10834)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:8941
	at h.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:145)
	at v.deliver (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:2266)
	at g.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:1844)
	at r.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:16515)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:118:17104
	at h.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:145)
	at v.deliver (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:2266)
	at g.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:1844)
	at r.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:16515)
	at o._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:21327)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:18770
	at h.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:145)
	at v.deliver (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:2266)
	at g.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:61:1844)
	at g.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:13346)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:12476
	at Socket.i (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:70:24594)
	at Socket.emit (node:events:526:28)
	at addChunk (node:internal/streams/readable:315:12)
	at readableAddChunk (node:internal/streams/readable:289:9)
	at Readable.push (node:internal/streams/readable:228:10)
	at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Nothing happens after I've installed

I've followed the installation instructions and nothing happens, either onSave or onEdit. Similar to what Anton and James raised in the reviews.

I ended up manually updating the Preferences: User Settings instead of the Preferences: Settings that is recommended (wasn't an option).

sqlfluff is installed and works from the command line.

I'm running:

  • macOS Monterey v12.3 (Apple M1 chip)
  • VSCode v1.74.2
  • vscode-sqlfluff v2.2.2.
  • sqlfluff v1.4.5

Please advise!

sub configs .sqlfluff not recognized

I am using sqlfluff through pyenv and managed to get the extension mostly working. I set the path explicitly. When I use this path and sqlfluff by command line it recognizes .sqlfluff config files deeper in the project. The extension unfortunately only picks up the top level config in the project.

Is this project still getting support?

Sqfluff doesn't register as a formatter

When I run the command "Format document" it throws the error on the image below

image

I'm using the following:

Version: 1.53.1
Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7
Date: 2021-02-08T23:35:15.302Z (2 days ago)
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0
sqlfluff: 0.4.0a3

Sqlfluf seems to be working fine but doesn't register as a formatter

VSCode option to specify ignores

I thought it might be nice to be able to specify ignores (e.g. parsing errors) in the VSCode problem highlighting, similar to in the CLI.

Cannot find executable - Windows 10

I'm getting the vscode error message on opening any SQL file;

"Cannot lint <..file>. The executable was not found. Use the 'Executable Path' setting to configure the location of the executable"

In the workspace settings.json, there is the configuration;

"sql.linter.executablePath": "${workspaceFolder}\.venv\Scripts\sqlfluff.exe"

... which exists.

I've also tried;

  • unix style path,
  • explicit path...
  • with / without .exe extension
  • with / without the "sqlfluff" ~ just the directory

Not sure what else to do. I've read the other similar issues but can't find a solution.

I have

which sqlfluff
/c/source/analytics-dbt-models/.venv/Scripts/sqlfluff
sqlfluff --version
sqlfluff, version 0.5.6

I have sqlfluff extension 0.0.15

Linting on save throws error but still appears to work(?)

I don't think its recognizing my .sqlfluff config file since its complaining about the dialect but then linting shows up anyway. the config is at /Users/dschneider/bombora/repos/topic-interest-score-af2-dags/bombora/bairflow/topic_interest_score/include/sql
my config:

dialect = bigquery
templater = jinja
sql_file_exts = .sql,.sql.j2,.dml,.ddl,.bqsql
# disable reorder select statements so aggregations are last
# disable complaint of USING() for joins
exclude_rules = L034, L032

[sqlfluff:templater]
unwrap_wrapped_queries = true

[sqlfluff:templater:jinja]
# Make dbt default macros like available like `ref`
apply_dbt_builtins = true
# Allow mocking dbt_utils and other packages through
# python files placed in this dir
library_path = ./sqlfluff_libs
load_macros_from_path = ../sql

[sqlfluff:rules]
max_line_length = 88

[sqlfluff:templater:jinja:context]
ds = "YYYY-MM-DD"
ds_nodash = "YYYYMMDD"

the error:

Reading from stdin, not file, input may be dirty/partial

--------------------Executing Command--------------------

/usr/local/bin/sqlfluff fix --force --exclude-rules L003,L054 --ignore parsing -

------------------------------------------------------------

Received close event, code 1 signal null
Raw stdout output:

------------------------------------------------------------



------------------------------------------------------------

Raw stderr output:

------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/local/bin/sqlfluff", line 33, in <module>

    sys.exit(load_entry_point('sqlfluff==1.3.1', 'console_scripts', 'sqlfluff')())

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in __call__

    return self.main(*args, **kwargs)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main

    rv = self.invoke(ctx)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1657, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke

    return __callback(*args, **kwargs)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/cli/commands.py", line 781, in fix

    result = lnt.lint_string_wrapped(stdin, fname="stdin", fix=True)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 1075, in lint_string_wrapped

    linted_path.add(self.lint_string(string, fname=fname, fix=fix))

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 920, in lint_string

    parsed = self.parse_string(

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 852, in parse_string

    rendered = self.render_string(in_str, fname, config, encoding)
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 788, in render_string

    config.verify_dialect_specified()

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/config.py", line 530, in verify_dialect_specified

    
raise SQLFluffUserError(
sqlfluff.core.errors.SQLFluffUserError: No dialect was specified. You must configure a dialect or specify one on the command line using --dialect after the command. Available dialects:
ansi, athena, bigquery, clickhouse, databricks, db2, exasol, hive, mysql, oracle, postgres, redshift, snowflake, soql, sparksql, sqlite, teradata, tsql


------------------------------------------------------------

Reading from file, not stdin

--------------------Executing Command--------------------

/usr/local/bin/sqlfluff lint --format json --exclude-rules L003,L054 --ignore parsing bombora/bairflow/topic_interest_score/include/sql/import_event_profile_tables.sql

------------------------------------------------------------

Received close event, code 1 signal null
Raw stdout output:

------------------------------------------------------------



------------------------------------------------------------

Raw stderr output:

------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/local/bin/sqlfluff", line 33, in <module>

    sys.exit(load_entry_point('sqlfluff==1.3.1', 'console_scripts', 'sqlfluff')())

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in __call__

    return self.main(*args, **kwargs)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main

    
rv = self.invoke(ctx)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1657, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke

    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke

    return __callback(*args, **kwargs)
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/cli/commands.py", line 579, in lint

    
result = lnt.lint_paths(
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 1173, in lint_paths

    self.lint_path(

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 1125, in lint_path

    for i, linted_file in enumerate(runner.run(fnames, fix), start=1):

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/runner.py", line 106, in run

    for fname, partial in self.iter_partials(fnames, fix=fix):

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/runner.py", line 59, in iter_partials

    for fname, rendered in self.iter_rendered(fnames):

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/runner.py", line 46, in iter_rendered

    yield fname, self.linter.render_file(fname, self.config)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 830, in render_file

    return self.render_string(raw_file, fname, config, encoding)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/linter/linter.py", line 801, in render_string

    
templated_file, templater_violations = self.templater.process(
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/base.py", line 53, in _wrapped

    return func(self, in_str=in_str, fname=fname, config=config, **kwargs)
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 376, in process

    env, live_context, make_template = self.template_builder(


  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 331, in template_builder

    live_context = self.get_context(fname=fname, config=config, env=env)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 311, in get_context

    self._extract_macros_from_path(
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 106, in _extract_macros_from_path

    cls._extract_macros_from_path(

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 91, in _extract_macros_from_path

    cls._extract_macros_from_template(template, env=env, ctx=ctx)
  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/sqlfluff/core/templaters/jinja.py", line 62, in _extract_macros_from_template

    for k in macro_template.module.__dict__:

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 1478, in module

    return self._get_default_module()

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 1446, in _get_default_module

    self._module = self.make_module()

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 1405, in make_module

    return TemplateModule(self, ctx)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 1535, in __init__

    body_stream = list(template.root_render_func(context))  # type: ignore

  File "<template>", line 12, in root

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 1010, in get_template

    return self._load_template(name, globals)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/environment.py", line 969, in _load_template

    template = self.loader.load(self, name, self.make_globals(globals))


  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/loaders.py", line 126, in load

    source, filename, uptodate = self.get_source(environment, name)

  File "/usr/local/Cellar/sqlfluff/1.3.1/libexec/lib/python3.10/site-packages/jinja2/loaders.py", line 218, in get_source

    raise TemplateNotFound(template)

jinja2.exceptions.TemplateNotFound
: 
sql/weekly__calc_tis__1_filter_features_for_bots_and_history.sql


------------------------------------------------------------```

Load configuration not working

Hi guys,

sqlfluff extension doesn't load config. Here are the specifications:

{
    "sqlfluff.executablePath": "${workspaceFolder}/.venv/bin/sqlfluff",
    "sqlfluff.config": "${workspaceFolder}/pyproject.toml",
    "sqlfluff.linter.run": "onSave",
}

This is currently my settings.json in the workspace. When I save the SQL file it doesn't show any errors. If I comment config line it works fine. I tried to specify exact PATH to the config but it didn't work.

If I run command line it works fine:
sqlfluff lint --config $PWD/pyproject.toml sample.sql

My specs are:

  • Python 3.9.6
  • sqlfluff 1.4.4
  • vscode extension sqlfluff v2.2.1

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.