d2rq/d2rq — pull request #232 by arekinath (2013-10-09 01:08:49+00:00)
Title: Use the ARQ Substitute operator before compiling queries

Queries that use a provided initial binding set (ie, parameterised queries) normally have the relevant var nodes replaced in the AST with value nodes by ARQ's Substitute operator. However, this currently happens _after_ d2rq's manipulations to turn chunks of the AST into SQL queries. As a result, initial-bound variables are treated like normal query bindings and are never compiled into an SQL statement.

This patch forces the use of Substitute in advance before the d2rq transformations, so that queries using initial bindings behave identically to those with inline literals in the same place.