Merged dev into feature/join-enhancements

This commit is contained in:
2023-09-27 09:16:08 -05:00
37 changed files with 2069 additions and 540 deletions

View File

@ -863,6 +863,16 @@ public abstract class AbstractRDBMSAction implements QActionInterface
/*******************************************************************************
** Make it easy (e.g., for tests) to turn on poor-man's formatting of SQL
*******************************************************************************/
public static void setLogSQLReformat(boolean doReformat)
{
System.setProperty("qqq.rdbms.logSQL.reformat", String.valueOf(doReformat));
}
/*******************************************************************************
**
*******************************************************************************/
@ -874,6 +884,19 @@ public abstract class AbstractRDBMSAction implements QActionInterface
{
params = params.size() <= 100 ? params : params.subList(0, 99);
/////////////////////////////////////////////////////////////////////////////
// (very very) poor man's version of sql formatting... if property is true //
/////////////////////////////////////////////////////////////////////////////
if(System.getProperty("qqq.rdbms.logSQL.reformat", "false").equalsIgnoreCase("true"))
{
sql = Objects.requireNonNullElse(sql, "").toString()
.replaceAll("FROM ", "\nFROM\n ")
.replaceAll("INNER", "\n INNER")
.replaceAll("LEFT", "\n LEFT")
.replaceAll("RIGHT", "\n RIGHT")
.replaceAll("WHERE", "\nWHERE\n ");
}
if(System.getProperty("qqq.rdbms.logSQL.output", "logger").equalsIgnoreCase("system.out"))
{
System.out.println("SQL: " + sql);