I want to use [ServiceStack's](http://www.servicestack.net/) [OrmLite](http://www.servicestack.net/docs/ormlite/ormlite-overview) in C# to query [AWS RedShift](https://aws.amazon.com/redshift/). AWS RedShift uses the postgresql wire protocol as its query interface, and puts some constraints on the queries that can be run, one of which is that it cannot accept parameterised queries (I've been told; I haven't actually been able to find this [backed up in documentation yet](http://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-features.html)).

So, I am investigating whether it would be possible to use an ORM to generate parameterised SQL, then find/replace in the parameter values.

How can I get access to the SQL generated by OrmLite to then change it before it is run?