diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index ade72e3..76f863f 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -90,10 +90,10 @@ export default class ModelQuery { public toString(final: boolean = false): string { let query = ''; - if (this._pivot) { - this.fields = this.fields.map(f => this.table + '.' + f); - this.fields.push(...this._pivot); - } + // Prevent wildcard and fields from conflicting + if (this._leftJoin) this.fields = this.fields.map(f => this.table + '.' + f); + + if (this._pivot) this.fields.push(...this._pivot); let fields = this.fields.join(',');