The Python SQL minifier you deserve, but not the one you need. #757
philippeboyd
started this conversation in
Show and tell
Replies: 1 comment
-
' '.join(sql.split()) works for me, need to exclude single line comments |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can't believe this library doesn't have an SQL minifier and no issue nor conversations were open regarding this...
So I've been scratching my head over this library as to why can't we easily minify SQL because sometime we want or have to.
I came up with this solution:
Which will result in
Now, granted, there are spaces before commas or semicolons but that's the best I came up with... I don't want to add a search and replace of
' ,'
and' ;'
because those string could be inside a valid SQL statement/column definition and whatnot.Let me know what you think.
Beta Was this translation helpful? Give feedback.
All reactions