brianc/node-sql — pull request #117 by kevinoid (2013-07-12 21:32:50+00:00)
Title: Provide mechanism for SELECTing literal values

**Reviewer Note:** I'm not attached to the name `.value()` or the placement on the `Sql` object. This pull request is more about opening discussion for how to support SELECTing literal values in some way. Personally, I'd probably treat non-node values passed to `.select()` as literal values so users don't accidentally shoot themselves in the foot, but since it is used in many places I realize it is probably an unreasonable change at this point.

Previously, the API did not provide a way to include a literal value in
a SELECT statement. Although users could include an un-escaped string
in the generated statement, this would require users to perform their
own value quoting and escaping. Although there was previously not much
use for literal values in SELECT, it is not an uncommon use when the
SELECT is part of an INSERT statement.

Add a .value() method to the Sql object which allows users to create
ParameterNodes for values. Users can then pass the result to .select()
to get literal values in their SELECT statements safely.

Add a test for this use case.

Signed-off-by: Kevin Locke