inline_sql_syntax icon indicating copy to clipboard operation
inline_sql_syntax copied to clipboard

SQL errors are not cleared out upon save

Open martinfr87 opened this issue 3 years ago • 1 comments

Using Visual Studio Code 1.73.1

Using

  • enableDBIntegration = true
  • dbDriver = mysql
  • lintSQLFiles = true

Create an .sql file in VS Code, enter a invalid SQL select query and hit Ctrl+S: the plugin warns about an SQL error. So far so good.

Now, correct the SQL error and hit Ctrl+S again: the red underline does not go away and the error stays. Close the .sql file and open it back: the error has disappeared.

The extension always seems to display the latest error even when the SQL syntax indeed is valid.

martinfr87 avatar Nov 19 '22 21:11 martinfr87

I'm facing the same problem.

For example when doing:

    Prisma.sql`--sql
-     DELETE FROM "User";
+     SELECT * FROM "User";
    `,
Screenshot 2023-08-16 at 15 31 24

As an annoying workaround I do:

  1. Delete last letter of --sql
    -  --sql
    +  --sq
    
  2. Save file
  3. Re-add last letter of --sql
    -  --sq
    +  --sql
    
  4. Save file

Would be really nice to see this fixed. This linting is super nice to have.

akd-io avatar Aug 16 '23 13:08 akd-io