Query Translation modules allow the SQL Relay server programs to alter queries before passing them to the database.
The translations section of the sqlrelay.conf file indicates which translation modules to load and what parameters to use when executing them.
<?xml version="1.0"?>
<instances>
...
<instance id="example" ... >
...
<translations>
<translation module="normalize"/>
</translations>
...
</instance>
...
</instances>
The module attribute specifies which module to load.
Module configurations may have attributes and/or nested tags. How these elements are interpreted is module-specific.
Currently, all translation modules have an enabled parameter, allowing the module to be temporarily disabled. If enabled="no" is configured, then the module is disabled. If set to any other value, or omitted, then the module is enabled.
Translation modules can be "stacked". Multiple modules may be loaded and multiple instances of the same type of module, with different configurations, may also be loaded.
<?xml version="1.0"?>
<instances>
...
<instance id="example" ... >
...
<translations>
<translation module="normalize"/>
<translation module="anothertranslation"/>
<translation module="andanothertranslation"/>
<translation module="yetanothertranslation"/>
</translations>
...
</instance>
...
</instances>
At startup, the SQL Relay server creates instances of the specified translations modules and initializes them. When a query is run, the server passes the query to each module, in the order that they were specified in the config file. If a module modifies the query, then that modified query is passed on to the next module.
Currently, the following translation module is available:
The normalize module performs the following operations on a query: