1

This should be a simple one but can't find which is the configuration option after looking at the documentation.

Example sql:

SELECT
    people.id,
    people.firstname,
    people.lastname,
    cities.name
FROM people LEFT JOIN cities ON cities.id = people.cityid WHERE people.firstname IN ('plop', 'zoo')

Output sql:

SELECT
    people.id,
    people.firstname,
    people.lastname,
    cities.name
FROM
    people
LEFT JOIN
    cities ON cities.id = people.cityid
WHERE people.firstname IN ('plop', 'zoo')

Current config in .sqlfluff:

[sqlfluff]
dialect = snowflake
sql_file_exts = .sql

I expect the sql to have the table name in the same line, both for the FROM and LEFT JOIN clauses. (The ON clause can be in the same line or the next one, but indented preferably)

Expected sql:

SELECT
    people.id,
    people.firstname,
    people.lastname,
    cities.name
FROM people
LEFT JOIN cities ON cities.id = people.cityid
WHERE people.firstname IN ('plop', 'zoo')

Can anyone point me to the right setting?

iDataEngX
  • 319
  • 2
  • 5
  • Have you found an answer to this somewhere else? I like the way your Expected SQL is formatted. – Dayl Apr 04 '23 at 09:28
  • Not really, I decided to use the default but I haven't used sqlfluff at the end, if I use it again, I'll update the question in case I find an answer. – iDataEngX May 04 '23 at 16:22
  • fyi this looks like an outstanding issue: https://github.com/sqlfluff/sqlfluff/issues/4906 – JayRizzo Jun 08 '23 at 16:50

0 Answers0