Alternate indentation & newline conventions

74 views
Skip to first unread message

Dan Frank

unread,
Oct 30, 2015, 7:31:02 AM10/30/15
to sqlparse
I've looked through the documentation and having trouble getting started on this one.

Current reindent format looks like this

SELECT COUNT(*) AS vim,
       a
FROM foo
JOIN bar ON a=b
WHERE b=c
  AND d=e
GROUP BY d

I'd like to force newlines for ON's following JOIN's and +1 indent for everything following a SELECT which roughly follows https://github.com/meadmaker/sql-style-guide e.g. 

SELECT COUNT(*), 
               a
  FROM foo
  JOIN bar 
    ON a=b
  WHERE b=c
    AND d=e
  GROUP BY d

Can anyone point me in the right direction for that kind of customization?

Andi Albrecht

unread,
Oct 30, 2015, 12:32:34 PM10/30/15
to sqlparse
Hi,

right now it's not possible.

But I'm planning to integrate new features to fine tune the formatting rules by configuration. There are no concrete plans how this could look like. So any suggestions on how the configuration could look like are welcome.

Please add suggestions on this issue: https://github.com/andialbrecht/sqlparse/issues/206
Or just follow it to get updates on this topic.

Cheers,

Andi

--
You received this message because you are subscribed to the Google Groups "sqlparse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlparse+u...@googlegroups.com.
To post to this group, send email to sqlp...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlparse.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages