[I57] MySQL implementation #65

Merged
rho_n merged 0 commits from refs/pull/65/head into main 2023-02-12 12:59:14 +00:00
Owner

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.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HPR/hpr_generator#65
No description provided.