Open Fresa opened 7 years ago
There isn't a straightforward seam around the variable substitution code to make that change. However, I've got two ways forward that will work within the current framework. One is a work-around and one is a quick summary of what the fix would be.
Unfortunately I'm a bit time-poor at the moment, and am not particularly familiar with PostgreSQL, so can't implement either in full myself.
The Work Around
IScriptPreprocessor
based on the existing VariableSubstitutionPreprocessor code with the important change of using your custom subclass of VariableSubstitutionSqlParser
from the first step..WithVariablesDisabled()
at configuration time..WithPreprocessor(...)
extension method during configuration.The Proper Fix
IScriptPreprocessor
based on the existing VariableSubstitutionPreprocessor code with the important change of using the custom subclass of VariableSubstitutionSqlParser
from the first step.SqlScriptExecutor
so that it creates the customised PostgreSQL variable substitution preprocessor at the appropriate time.SqlScriptExecutor
.
$variablename$
is used by PostgreSQL as dollar quoting: https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTINGIt would be nice to be able to decide which token to use, or completely swap out the VariableSubstitutionPreprocessor.