brianc/node-sql — pull request #99 by diwu1989 (2013-06-16 00:15:17+00:00)
Title: To query refactor to allow toString

Dialects need a parallel getString in addition to getQuery that walks the tree and sticks escaped values into the query string.

toQuery now takes an optional parameter that allow overriding the dialect being used. The parallel dialect change broke toQuery for nodes that didn't have a sql or table instance attached to them, this change restores the ability to toQuery any node.

toString goes through the same code path as toQuery, expect the dialect will determine parameter node behavior through the methods depending on whether a _disableParameterPlaceholders flag is set or not. That flag is set and unset with a try finally while walking the tree.

The test harness is updated to check the string output of a query, all the tests are being updated to include the string representation.