Skip to content

Commit

Permalink
chore: fix order of placeholders for multiple joins (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-vogel authored Nov 18, 2024
1 parent c61a04a commit e341af4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions db-service/lib/cqn2sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,7 @@ class CQN2SQLRenderer {
return _aliased(this.quote(this.name(z)))
}
if (from.SELECT) return _aliased(`(${this.SELECT(from)})`)
if (from.join) {
const joinCondition = from.on ? ` ON ${this.where(from.on)}` : '';
return `${this.from(from.args[0])} ${from.join} JOIN ${this.from(from.args[1])}${joinCondition}`;
}
if (from.join) return `${this.from(from.args[0])} ${from.join} JOIN ${this.from(from.args[1])}${from.on ? ` ON ${this.where(from.on)}` : ''}`
}

/**
Expand Down

0 comments on commit e341af4

Please sign in to comment.