ktorm icon indicating copy to clipboard operation
ktorm copied to clipboard

Operator precedence issue

Open zhanwangls opened this issue 4 years ago • 1 comments

for example Ts.update { it.companyTaxNo to companyTaxNo where { it.userId eq userId and it.deleted eq false } } The format sql is 'where ((user_id=?) and is_deleted)=?'。 In mysql, the sql will affect all rows。

I know, we should use (it.userId eq userId) and (it.deleted eq false)。 But, I suggest ktorm to throw exception when users don't use the () 。 It is dangers for new hand.

Thanks,look forward for your reply !

zhanwangls avatar Mar 02 '21 04:03 zhanwangls

Good suggestion, let's check if there is a good solution to avoid this.

vincentlauvlwj avatar Mar 02 '21 06:03 vincentlauvlwj