0

I'm using SQLFluff to lint my queries and am getting Found unparsable section errors whenever a query contains IF NOT EXISTS.

I've tried several different dialects with no success. Is it possible for SQLFluff to accept these types of queries without throwing errors?

For example:

CREATE TABLE IF NOT EXISTS Core.Test (
Id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(128) NOT NULL UNIQUE,
PRIMARY KEY (id)
);

Throws:

L:   4 | P:   1 |  PRS | Line 4, Position 1: Found unparsable section: 'CREATE TABLE IF NOT EXISTS Core.Test'
WARNING: Parsing errors found and dialect is set 
Ryan Dunphy
  • 792
  • 2
  • 10
  • 33
  • Please share at least one example query that gives an error. – Yoichi Nakayama Nov 02 '22 at 12:36
  • Thank you for sharing your query. The parse error was not reproducible with sqlfluff version 1.4.4 and the mysql dialect. Could you please confirm the version of sqlfluff and the dialect you are using? – Yoichi Nakayama Dec 15 '22 at 11:42

0 Answers0