芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/@sentry/tracing/esm/integrations/mysql.js
import { dynamicRequire, fill, logger } from '@sentry/utils'; /** Tracing integration for node-mysql package */ var Mysql = /** @class */ (function () { function Mysql() { /** * @inheritDoc */ this.name = Mysql.id; } /** * @inheritDoc */ Mysql.prototype.setupOnce = function (_, getCurrentHub) { var connection; try { // Unfortunatelly mysql is using some custom loading system and `Connection` is not exported directly. connection = dynamicRequire(module, 'mysql/lib/Connection.js'); } catch (e) { logger.error('Mysql Integration was unable to require `mysql` package.'); return; } // The original function will have one of these signatures: // function (callback) => void // function (options, callback) => void // function (options, values, callback) => void fill(connection.prototype, 'query', function (orig) { return function (options, values, callback) { var _a, _b; var scope = getCurrentHub().getScope(); var parentSpan = (_a = scope) === null || _a === void 0 ? void 0 : _a.getSpan(); var span = (_b = parentSpan) === null || _b === void 0 ? void 0 : _b.startChild({ description: typeof options === 'string' ? options : options.sql, op: "db", }); if (typeof callback === 'function') { return orig.call(this, options, values, function (err, result, fields) { var _a; (_a = span) === null || _a === void 0 ? void 0 : _a.finish(); callback(err, result, fields); }); } if (typeof values === 'function') { return orig.call(this, options, function (err, result, fields) { var _a; (_a = span) === null || _a === void 0 ? void 0 : _a.finish(); values(err, result, fields); }); } return orig.call(this, options, values, callback); }; }); }; /** * @inheritDoc */ Mysql.id = 'Mysql'; return Mysql; }()); export { Mysql }; //# sourceMappingURL=mysql.js.map