Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/share/.cache/yarn/v6/npm-knex-2.4.0-integrity/node_modules/knex/lib/execution/internal/ drwxr-xr-x | |
| Viewing file: Select action/file-type: const _debugQuery = require('debug')('knex:query');
const debugBindings = require('debug')('knex:bindings');
const debugQuery = (sql, txId) => _debugQuery(sql.replace(/%/g, '%%'), txId);
const { isString } = require('../../util/is');
function formatQuery(sql, bindings, timeZone, client) {
bindings = bindings == null ? [] : [].concat(bindings);
let index = 0;
return sql.replace(/\\?\?/g, (match) => {
if (match === '\\?') {
return '?';
}
if (index === bindings.length) {
return match;
}
const value = bindings[index++];
return client._escapeBinding(value, { timeZone });
});
}
function enrichQueryObject(connection, queryParam, client) {
const queryObject = isString(queryParam) ? { sql: queryParam } : queryParam;
queryObject.bindings = client.prepBindings(queryObject.bindings);
queryObject.sql = client.positionBindings(queryObject.sql);
const { __knexUid, __knexTxId } = connection;
client.emit('query', Object.assign({ __knexUid, __knexTxId }, queryObject));
debugQuery(queryObject.sql, __knexTxId);
debugBindings(queryObject.bindings, __knexTxId);
return queryObject;
}
function executeQuery(connection, queryObject, client) {
return client._query(connection, queryObject).catch((err) => {
if (client.config && client.config.compileSqlOnError === false) {
err.message = queryObject.sql + ' - ' + err.message;
} else {
err.message =
formatQuery(queryObject.sql, queryObject.bindings, undefined, client) +
' - ' +
err.message;
}
client.emit(
'query-error',
err,
Object.assign(
{ __knexUid: connection.__knexUid, __knexTxId: connection.__knexUid },
queryObject
)
);
throw err;
});
}
module.exports = {
enrichQueryObject,
executeQuery,
formatQuery,
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0079 ]-- |