Closed ulikunitz closed 1 month ago
First, please read the FAQ. There's nothing I can do about the Prettier SQL VSCode extension.
However, this bug does partly exist in the latest SQL Formatter library. There are essentially two issues:
ON CONFLICT
clause is not printed to a separate line (this is fixed in latest SQL Formatter)UPDATE
in DO UPDATE
is recognized as start of an UPDATE
statement.The latter can be easily fixed in SQL Formatter. Though I suggest you give a try to prettier-plugin-sql-cst, which has full support for SQLite, and in general does much better job at formatting SQL.
Input data
Which SQL and options did you provide as input?
I use Prettier SQL VSCode with sqlite mode.
Expected Output
Actual Output
I suggest to move
on conflict (id) do
to the next line.Usage
I'm using the library with Prettier SQL VS Code and use sqlite mode.
Sqlite. Note that sqlite supports multiple on conflict clauses. The syntax is defined here: (https://www.sqlite.org/lang_upsert.html) The page reports that it used the syntax from postfgresql and changed it.
Prettier SQL VSCode 1.6