@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.js CHANGED
@@ -1202,10 +1202,15 @@ var _IndexOptimizer = class _IndexOptimizer {
1202
1202
  }
1203
1203
  toDefinition(permuted) {
1204
1204
  const make = (col, order, where, keyword) => {
1205
- const fullyQualifiedTable = PgIdentifier.fromParts(
1206
- permuted.schema,
1207
- permuted.table
1208
- );
1205
+ let fullyQualifiedTable;
1206
+ if (permuted.schema.toString() === "public") {
1207
+ fullyQualifiedTable = PgIdentifier.fromString(permuted.table);
1208
+ } else {
1209
+ fullyQualifiedTable = PgIdentifier.fromParts(
1210
+ permuted.schema,
1211
+ permuted.table
1212
+ );
1213
+ }
1209
1214
  const baseColumn = `${fullyQualifiedTable}(${permuted.columns.map((c) => {
1210
1215
  const column = PgIdentifier.fromString(c.column);
1211
1216
  const direction = c.sort && this.sortDirection(c.sort);