synatic / noql

Converts SQL queries to Mongo find or aggregates
https://noql.synatic.dev/
GNU General Public License v3.0
47 stars 12 forks source link

Conditional Clauses in SQL Join Don't Work #133

Closed BrianH824 closed 1 year ago

BrianH824 commented 1 year ago

Example:

      select a.ID as aId,
             b.name as bName
      from   [something.tablea] a
      join   [something.tableb] b on a.ID = b.ID and b.IsDeleted = 'false'

This query (and ones more complicated, where a conditional in a join makes sense) will fail. This will throw the error in makeFilterCondition.js: invalid expression type for array sub select:bool, as it identifies the conditional in the join as a subselect. Simply adding 'bool' to the array on line 169 in the same file fixes this issue.

BrianH824 commented 1 year ago

Pull Request: https://github.com/synatic/noql/pull/134

eXigentCoder commented 1 year ago

Thanks, this has been fixed in #143