Skip to content

Ensure 'debug_pretty_print' is enabled

Description

Enabling debug_pretty_print indents the messages produced by debug_print_parse, debug_print_rewritten, or debug_print_plan making them significantly easier to read.

Rationale

If this setting is disabled, the "compact" format is used instead, significantly reducing readability of the DEBUG statement log messages.

Applies To

  • Databases

Tags

This rule is applied when the following tags are present:

Tag With Value
secureclouddb/provider aws
secureclouddb/service rds
secureclouddb/engine postgres

Default Rule

const { checkServerSetting } = module
/**
 * @param {Object} databaseSettings - database settings object
 * @returns {boolean} true if debug_pretty_print is enabled
 */

function validate(databaseSettings) {
    const settingName = 'debug_pretty_print'
    const expectedValue = 'on'
    const success = checkServerSetting(databaseSettings, settingName, expectedValue)
    return {
        success,
    }
}

// invoke
validate(databaseSettings);