Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
feat: align debug behaviour with cap standard (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf committed Nov 9, 2022
1 parent f037f81 commit ffe84a3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/pg/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { postProcess, getPostProcessMapper } = require('@sap/cds/libx/_runtime/db
const { PG_TYPE_CONVERSION_MAP } = require('./converters/conversion')
const { flattenArray } = require('./utils/deep')
const { remapColumnNames } = require('./utils/columns')
const DEBUG = cds.debug('cds-pg')
const DEBUG = cds.debug('cds-pg|sql')

/*
* Those are the custom execution functions that generate and/or modify the SQL to run on Postgres.
Expand Down Expand Up @@ -103,8 +103,7 @@ async function executePlainSQL(dbc, rawSql, rawValues) {
values: rawValues
})

DEBUG && DEBUG('sql > ', sql)
DEBUG && values && values.length > 0 && DEBUG('values > ', values)
DEBUG && DEBUG(sql, values)

// values will be often undefined but is required for potential queries using placeholders
const result = await dbc.query(sql, values)
Expand Down Expand Up @@ -211,8 +210,7 @@ const _appendReturning = (query) => {
* @returns {import('pg').QueryResult} the executed and processed result
*/
async function _executeSQLReturningRows(dbc, sql, values, isOne, postMapper, propertyMapper, objStructMapper) {
DEBUG && DEBUG('sql > ', sql)
DEBUG && values && values.length > 0 && DEBUG('values > ', values)
DEBUG && DEBUG(sql, values)

let rawResult = await dbc.query(sql, values)
let result
Expand Down

0 comments on commit ffe84a3

Please sign in to comment.