{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport type { Span } from '@opentelemetry/api';\n\nexport interface MySQL2ResponseHookInformation {\n  queryResults: any;\n}\n\nexport interface MySQL2InstrumentationExecutionResponseHook {\n  (span: Span, responseHookInfo: MySQL2ResponseHookInformation): void;\n}\n\nexport interface MySQL2InstrumentationQueryMaskingHook {\n  (query: string): string;\n}\n\nexport interface MySQL2InstrumentationConfig extends InstrumentationConfig {\n  /**\n   * If true, the query will be masked before setting it as a span attribute, using the {@link maskStatementHook}.\n   *\n   * @default false\n   * @see maskStatementHook\n   */\n  maskStatement?: boolean;\n\n  /**\n   * Hook that allows masking the query string before setting it as span attribute.\n   *\n   * @default (query: string) => query.replace(/\\b\\d+\\b/g, '?').replace(/([\"'])(?:(?=(\\\\?))\\2.)*?\\1/g, '?')\n   */\n  maskStatementHook?: MySQL2InstrumentationQueryMaskingHook;\n\n  /**\n   * Hook that allows adding custom span attributes based on the data\n   * returned MySQL2 queries.\n   *\n   * @default undefined\n   */\n  responseHook?: MySQL2InstrumentationExecutionResponseHook;\n\n  /**\n   * If true, queries are modified to also include a comment with\n   * the tracing context, following the {@link https://github.com/open-telemetry/opentelemetry-sqlcommenter sqlcommenter} format\n   */\n  addSqlCommenterCommentToQueries?: boolean;\n}\n"]}