ujjwalguptaofficial / JsStore

A complete IndexedDB wrapper with SQL like syntax.
http://jsstore.net/
MIT License
849 stars 109 forks source link

or condition and array in where does not works when using within joins #356

Closed Aparnai7 closed 9 months ago

Aparnai7 commented 9 months ago

Title

or condition and array in where does not works when using within joins

Description

select({ from: "Orders", join: [{ with: 'Customers', on: 'Customers.customerId=Orders.customerId', where: [{ customerId: 87, },{ or: { customerId: 85, }, }] }, { with: 'Employees', on: 'Employees.employeeId = Orders.employeeId', }, ], where: [{ shipperId: 3 }] });

whenever we try to use "or" condition OR use array in where condition inside joins, it does not work

ujjwalguptaofficial commented 9 months ago

@Aparnai7 thanks for raising the issue, i am able to reproducing the issue and working on fixes - it seems like issue is in array query inside where.

ujjwalguptaofficial commented 9 months ago

it's fixed in v - 4.7.1, please check and let me know. Happy coding.

ujjwalguptaofficial commented 9 months ago

check here - https://ujjwalguptaofficial.github.io/idbstudio/?db=Demo&query=select(%7B%0A%20%20%20%20from%3A%20%22Orders%22%2C%0A%20%20%20%20join%3A%20%5B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20with%3A%20'Customers'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20on%3A%20'Customers.customerId%3DOrders.customerId'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20where%3A%20%5B%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20customerId%3A%2087%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20or%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20customerId%3A%2085%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%5D%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20with%3A%20'Employees'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20on%3A%20'Employees.employeeId%20%3D%20Orders.employeeId'%2C%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%5D%2C%0A%20%20%20%20where%3A%20%5B%7B%0A%20%20%20%20%20%20%20%20shipperId%3A%203%0A%20%20%20%20%7D%5D%0A%7D)%3B