You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Variable substitution tokens incompatible with PostgreSQL #1
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
Create a PostgreSQL-specific variable preprocessor by inheriting from VariableSubstitutionSqlParser and specifying your own delimiter characters.
Create your own implementation of IScriptPreprocessor based on the existing VariableSubstitutionPreprocessor code with the important change of using your custom subclass of VariableSubstitutionSqlParser from the first step.
Disable the built-in variable substitution pre-processor by calling .WithVariablesDisabled() at configuration time.
Add your custom script preprocessor to your database upgrader using the .WithPreprocessor(...) extension method during configuration.
The Proper Fix
Create a PostgreSQL-specific variable preprocessor by inheriting from VariableSubstitutionSqlParser and specifying appropriate delimiter characters.
Create a PostgreSQL implementation of IScriptPreprocessor based on the existing VariableSubstitutionPreprocessor code with the important change of using the custom subclass of VariableSubstitutionSqlParser from the first step.
Copy and modify SqlScriptExecutor so that it creates the customised PostgreSQL variable substitution preprocessor at the appropriate time.
Update all configuration extension methods for PostgreSQL to wire-in the replacement, specialised SqlScriptExecutor.
Activity
AdrianJSClark commentedon Aug 1, 2017
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
IScriptPreprocessorbased on the existing VariableSubstitutionPreprocessor code with the important change of using your custom subclass ofVariableSubstitutionSqlParserfrom the first step..WithVariablesDisabled()at configuration time..WithPreprocessor(...)extension method during configuration.The Proper Fix
IScriptPreprocessorbased on the existing VariableSubstitutionPreprocessor code with the important change of using the custom subclass ofVariableSubstitutionSqlParserfrom the first step.SqlScriptExecutorso that it creates the customised PostgreSQL variable substitution preprocessor at the appropriate time.SqlScriptExecutor.droyad commentedon Dec 10, 2024
Also see linked issues for more use cases