@query-doctor/core 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/optimizer/genalgo.d.ts.map +1 -1
- package/dist/optimizer/statistics.d.ts.map +1 -1
- package/dist/sql/analyzer.d.ts.map +1 -1
- package/dist/sql/walker.d.ts.map +1 -1
- package/package.json +2 -3
- package/.eslintrc.cjs +0 -4
package/dist/index.cjs
CHANGED
|
@@ -344,9 +344,12 @@ var Walker = class _Walker {
|
|
|
344
344
|
part.schema = node.RangeVar.schemaname;
|
|
345
345
|
}
|
|
346
346
|
if (existingMapping) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
const isSystemCatalog = node.RangeVar.relname?.startsWith("pg_") ?? false;
|
|
348
|
+
if (!isSystemCatalog) {
|
|
349
|
+
console.warn(
|
|
350
|
+
`Ignoring alias ${aliasName} as it shadows an existing mapping for ${existingMapping.text}. We currently do not support alias shadowing.`
|
|
351
|
+
);
|
|
352
|
+
}
|
|
350
353
|
this.shadowedAliases.push(part);
|
|
351
354
|
return;
|
|
352
355
|
}
|
|
@@ -744,7 +747,7 @@ var Analyzer = class {
|
|
|
744
747
|
return { tags: [], queryWithoutTags: trimmedQuery };
|
|
745
748
|
}
|
|
746
749
|
const queryWithoutTags = trimmedQuery.slice(0, startPosition);
|
|
747
|
-
const tagString = trimmedQuery.slice(startPosition + 2, endPosition);
|
|
750
|
+
const tagString = trimmedQuery.slice(startPosition + 2, endPosition).trim();
|
|
748
751
|
if (!tagString || typeof tagString !== "string") {
|
|
749
752
|
return { tags: [], queryWithoutTags };
|
|
750
753
|
}
|
|
@@ -752,7 +755,11 @@ var Analyzer = class {
|
|
|
752
755
|
for (const match of tagString.split(",")) {
|
|
753
756
|
const [key, value] = match.split("=");
|
|
754
757
|
if (!key || !value) {
|
|
755
|
-
|
|
758
|
+
if (tags.length > 0) {
|
|
759
|
+
console.warn(
|
|
760
|
+
`Invalid sqlcommenter tag: ${match} in comment: ${tagString}. Ignoring`
|
|
761
|
+
);
|
|
762
|
+
}
|
|
756
763
|
continue;
|
|
757
764
|
}
|
|
758
765
|
try {
|