@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.js CHANGED
@@ -294,9 +294,12 @@ var Walker = class _Walker {
294
294
  part.schema = node.RangeVar.schemaname;
295
295
  }
296
296
  if (existingMapping) {
297
- console.warn(
298
- `Ignoring alias ${aliasName} as it shadows an existing mapping for ${existingMapping.text}. We currently do not support alias shadowing.`
299
- );
297
+ const isSystemCatalog = node.RangeVar.relname?.startsWith("pg_") ?? false;
298
+ if (!isSystemCatalog) {
299
+ console.warn(
300
+ `Ignoring alias ${aliasName} as it shadows an existing mapping for ${existingMapping.text}. We currently do not support alias shadowing.`
301
+ );
302
+ }
300
303
  this.shadowedAliases.push(part);
301
304
  return;
302
305
  }
@@ -694,7 +697,7 @@ var Analyzer = class {
694
697
  return { tags: [], queryWithoutTags: trimmedQuery };
695
698
  }
696
699
  const queryWithoutTags = trimmedQuery.slice(0, startPosition);
697
- const tagString = trimmedQuery.slice(startPosition + 2, endPosition);
700
+ const tagString = trimmedQuery.slice(startPosition + 2, endPosition).trim();
698
701
  if (!tagString || typeof tagString !== "string") {
699
702
  return { tags: [], queryWithoutTags };
700
703
  }
@@ -702,7 +705,11 @@ var Analyzer = class {
702
705
  for (const match of tagString.split(",")) {
703
706
  const [key, value] = match.split("=");
704
707
  if (!key || !value) {
705
- console.warn(`Invalid sqlcommenter tag: ${match}. Ignoring`);
708
+ if (tags.length > 0) {
709
+ console.warn(
710
+ `Invalid sqlcommenter tag: ${match} in comment: ${tagString}. Ignoring`
711
+ );
712
+ }
706
713
  continue;
707
714
  }
708
715
  try {