Add MySQL database support to the hpr templates. Unfortunately there are enough differences in the MySQL and SQLite query syntax (in particular when using date functions) that either separate branches in the repository would need to be maintained for each database or the templates would need to programatically adjust based on the current database being used.
I chose the later option. Now any SQL query that needs modified depending on the database being used is split out into a separate template with the following naming convention:
queries-<page name>-<database name>.tpl.html
These queries can be in the calling template with the following PROCESS MACRO:
<!--% PROCESS "queries-<page name name>-${constants.database}.tpl.html" %-->
With this, any supported database can be add by just including new query templates.
Add MySQL database support to the hpr templates. Unfortunately there are enough differences in the MySQL and SQLite query syntax (in particular when using date functions) that either separate branches in the repository would need to be maintained for each database or the templates would need to programatically adjust based on the current database being used.
I chose the later option. Now any SQL query that needs modified depending on the database being used is split out into a separate template with the following naming convention:
queries-\<page name\>-\<database name\>.tpl.html
These queries can be in the calling template with the following PROCESS MACRO:
\<!--% PROCESS "queries-\<page name name\>-${constants.database}.tpl.html" %--\>
With this, any supported database can be add by just including new query templates.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Add MySQL database support to the hpr templates. Unfortunately there are enough differences in the MySQL and SQLite query syntax (in particular when using date functions) that either separate branches in the repository would need to be maintained for each database or the templates would need to programatically adjust based on the current database being used.
I chose the later option. Now any SQL query that needs modified depending on the database being used is split out into a separate template with the following naming convention:
queries-<page name>-<database name>.tpl.html
These queries can be in the calling template with the following PROCESS MACRO:
<!--% PROCESS "queries-<page name name>-${constants.database}.tpl.html" %-->
With this, any supported database can be add by just including new query templates.