@query-doctor/core 0.1.12 → 0.2.0

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 CHANGED
@@ -1252,10 +1252,15 @@ var _IndexOptimizer = class _IndexOptimizer {
1252
1252
  }
1253
1253
  toDefinition(permuted) {
1254
1254
  const make = (col, order, where, keyword) => {
1255
- const fullyQualifiedTable = PgIdentifier.fromParts(
1256
- permuted.schema,
1257
- permuted.table
1258
- );
1255
+ let fullyQualifiedTable;
1256
+ if (permuted.schema.toString() === "public") {
1257
+ fullyQualifiedTable = PgIdentifier.fromString(permuted.table);
1258
+ } else {
1259
+ fullyQualifiedTable = PgIdentifier.fromParts(
1260
+ permuted.schema,
1261
+ permuted.table
1262
+ );
1263
+ }
1259
1264
  const baseColumn = `${fullyQualifiedTable}(${permuted.columns.map((c) => {
1260
1265
  const column = PgIdentifier.fromString(c.column);
1261
1266
  const direction = c.sort && this.sortDirection(c.sort);