Skip to content

Commit 998b7cc

Browse files
authored
Merge branch 'main' into trentm-semconv-up-ioredis
2 parents 0013042 + b2e5483 commit 998b7cc

File tree

5 files changed

+187
-84
lines changed

5 files changed

+187
-84
lines changed

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@d3ced5c96c16c4332e2a61eb6f3649d6f1b20bb8 # v3.31.5
45+
uses: github/codeql-action/upload-sarif@497990dfed22177a82ba1bbab381bc8f6d27058f # v3.31.6
4646
with:
4747
sarif_file: results.sarif

package-lock.json

Lines changed: 72 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"karma-mocha": "2.0.1",
7272
"karma-spec-reporter": "0.0.36",
7373
"karma-webpack": "5.0.1",
74-
"lerna": "9.0.1",
74+
"lerna": "9.0.3",
7575
"markdownlint-cli2": "0.19.1",
7676
"minimatch": "9.0.5",
7777
"mocha": "11.7.5",

packages/instrumentation-pg/src/instrumentation.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -333,19 +333,24 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
333333
// TODO: remove the `as ...` casts below when the TS version is upgraded.
334334
// Newer TS versions will use the result of firstArgIsQueryObjectWithText
335335
// to properly narrow arg0, but TS 4.3.5 does not.
336-
const queryConfig = firstArgIsString
337-
? {
338-
text: arg0 as string,
339-
values: Array.isArray(args[1]) ? args[1] : undefined,
340-
}
341-
: firstArgIsQueryObjectWithText
342-
? {
343-
...(arg0 as any),
344-
values:
345-
(arg0 as any).values ??
346-
(Array.isArray(args[1]) ? args[1] : undefined),
347-
}
348-
: undefined;
336+
let queryConfig: any;
337+
338+
if (firstArgIsString) {
339+
queryConfig = {
340+
text: arg0 as string,
341+
values: Array.isArray(args[1]) ? args[1] : undefined,
342+
};
343+
} else if (firstArgIsQueryObjectWithText) {
344+
const q = arg0 as any;
345+
346+
if (q.values === undefined && Array.isArray(args[1])) {
347+
q.values = args[1];
348+
}
349+
350+
queryConfig = q;
351+
} else {
352+
queryConfig = undefined;
353+
}
349354

350355
const attributes: Attributes = {
351356
[ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,

0 commit comments

Comments
 (0)