SimpleFinance/jdub — pull request #42 by jklukas (2014-11-07 20:21:27+00:00)
Title: trim function should handle queries with comments

Currently, if `trim` is called on a multiline string containing SQL comments, the result is invalid SQL. This PR modifies the `trim` function to preserve the break after any line that looks like it might contain a comment. It should produce identical output for uncommented queries.

The entirely correct solution here would be to strip all comments, but that greatly increases complexity to the point that we would probably want use a SQL parsing library. That seems ridiculous.

The minimal alternative would be to leave the `trim` function as is, but add comments and documentation which draw attention to the lack of commenting support.