Algorithm for neatly indenting SQL statements (Python implementation would be nice) [closed]
Asked Answered
W

0

23

I'd like to reformat some SQL statements that are a single string with newlines in to something that's much easier to read.

I don't personally know of a good coding style for indenting SQL - how should nested queries / where clauses / left joins / etc by represented to maximise readability?

Has anyone seen a pretty-printing algorithm that does this already? In Python would be even better.

Weanling answered 28/4, 2009 at 14:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.