diff --git a/.sqlfluff b/.sqlfluff new file mode 100644 index 0000000..5db1c82 --- /dev/null +++ b/.sqlfluff @@ -0,0 +1,26 @@ +[sqlfluff] +dialect = ansi +templater = jinja +exclude_rules = L009 # trailing comma enforcement skipped +format = json +nocolor = True + +[sqlfluff:rules] +max_line_length = 100 +tab_space_size = 4 + +[sqlfluff:rules:L010] # Keywords +capitalisation_policy = upper + +[sqlfluff:rules:L014] # Unquoted identifiers +extended_capitalisation_policy = consistent + +[sqlfluff:rules:L016] # Line length +max_line_length = 100 + +[sqlfluff:rules:L019] # Leading comma check +comma_style = trailing + +[sqlfluff:rules:L030] # Function names +capitalisation_policy = lower + diff --git a/example.sql b/example.sql new file mode 100644 index 0000000..ed5342c --- /dev/null +++ b/example.sql @@ -0,0 +1,19 @@ +SELECT id,Name , age FROM users WHERE age>25 order BY name; + +SELECT select, from, where FROM keywords; + +SELECT + id + name + email +FROM customers; + +SELECT u.id, o.order_id, o.amount FROM users u +JOIN orders o +on u.id = o.user_id +WHERE o.amount>1000; + +SELECT a.id, b.value +FROM table1 a, table2 b +WHERE a.id = b.id; +