sql-formatter-org / sql-formatter

A whitespace formatter for different query languages
https://sql-formatter-org.github.io/sql-formatter/
MIT License
2.23k stars 392 forks source link

Unable to configure to use the configuration setting for placeholders #712

Closed mellasmpa closed 5 months ago

mellasmpa commented 5 months ago

Input data

Which SQL and options did you provide as input?

SELECT * FROM receipts WHERE tin = {tin}

Expected Output

SELECT
    *
FROM
    receipts
WHERE
    tin = {tin}

Actual Output

Unable to format SQL: Error: Parse Error: Unexpected "{tin}"

Usage

When I save my query it produces the above error with sqlite. The version I am running is 4.0.3

nene commented 5 months ago

I suspect you're using SQL Formatter VSCode version 4.0.2 (not the 4.0.3 from the future).

You say that you're unable to configure it to understand these {..} placeholder. Could you please provide the configuration options you are using? In particular, what have you configured as the value of SQL-Formatter-VSCode.paramTypes.

mellasmpa commented 5 months ago

Kindly find bellow my configurations.

  "SQL-Formatter-VSCode.paramTypes": {
    "placeholder": "{}"
  },
  "SQL-Formatter-VSCode.functionCase": "upper",
  "SQL-Formatter-VSCode.keywordCase": "upper",
  "SQL-Formatter-VSCode.ignoreTabSettings": true,
  "SQL-Formatter-VSCode.tabSizeOverride": 4,
  "SQL-Formatter-VSCode.dialect": "sqlite",
mellasmpa commented 5 months ago

Thank you for your support. I followed the instructions from the link provided above and it worked.

Thank you.