magda-io / magda

A federated, open-source data catalog for all your big data and small data
https://magda.io
Apache License 2.0
505 stars 92 forks source link

scalikejdbc `toOrConditionOpt` or `toAndConditionOpt` fails to generate round brackets correctly #3440

Closed t83714 closed 1 year ago

t83714 commented 1 year ago

scalikejdbc toOrConditionOpt or toAndConditionOpt fails to generate round brackets correctly

The toOrConditionOpt or toAndConditionOpt method from scalikejdbc will auto wrap SQL statements with round brackets when and or or is detected in the statement. However, the detection regex doesn't work properly when the statement contains newlines.

This ticket will fix this issue by adding a new implementation of toOrConditionOpt or toAndConditionOpt to SQLUtils

this issue seems won't lead to incorrect logic but still worth to fix as it make generated SQL hard to read when debug

t83714 commented 1 year ago

closed via PR: https://github.com/magda-io/magda/pull/3441