Visual Studio Code の拡張機能である sqlfluff を利用する際には `sqlfluff.dialect` を指定する必要あり

## 概要

Visual Studio Code にて sqlfluff 利用時には `sqlfluff.dialect` を指定する必要あるようです。デフォルトでは、空白（`"sqlfluff.dialect": ""`）となっているようです。

デフォルト設定のまま利用しようと、次のようなエラーメッセージが表示されます。

```text
Traceback (most recent call last):
  File "/home/manabian/.local/bin/sqlfluff", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main

    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke

    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke

    return callback(*args, **kwargs)
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/cli/commands.py", line 949, in fix

    _stdin_fix(lnt, formatter, fix_even_unparsable)
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/cli/commands.py", line 712, in _stdin_fix

    result = linter.lint_string_wrapped(stdin, fname="stdin", fix=True)
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/core/linter/linter.py", line 1112, in lint_string_wrapped

    linted_path.add(self.lint_string(string, fname=fname, fix=fix))
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/core/linter/linter.py", line 950, in lint_string

    
parsed = self.parse_string(
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/core/linter/linter.py", line 882, in parse_string

    rendered = self.render_string(in_str, fname, config, encoding)
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/core/linter/linter.py", line 818, in render_string

    config.verify_dialect_specified()
  File "/home/manabian/.local/lib/python3.8/site-packages/sqlfluff/core/config.py", line 791, 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, duckdb, exasol, hive, materialize, mysql, oracle, postgres, redshift, snowflake, soql, sparksql, sqlite, teradata, tsql
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/24031/29877a54-e7e9-bd1a-73df-6e9f52187a51.png)


上記メッセージの下部にて、方言（`dialect`）を指定する必要がある旨が記載されております。

```text
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, duckdb, exasol, hive, materialize, mysql, oracle, postgres, redshift, snowflake, soql, sparksql, sqlite, teradata, tsql
```

## エラーへの対応方法

VS Code における sqlfluff の方言の設定値(`sqlfluff.dialect`)を検索し、いずれかの値に設定します。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/24031/b1a85953-6695-36cd-8a89-40ce79bd22c3.png)

上記の設定後、ドキュメントのフォーマットを実施できます。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/24031/29eda48d-0bff-1e82-031a-fedb970a1272.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/24031/07e81ad6-2dc8-de3c-5b5a-b0aa8ce7f799.png)