Skip to content

Commit

Permalink
handle edge case with multiple Case If statements
Browse files Browse the repository at this point in the history
  • Loading branch information
godenji committed May 12, 2022
1 parent 32b5349 commit 6866a21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/slaq/scalaquery/ql/core/QueryBuilder.scala
Expand Up @@ -191,6 +191,11 @@ abstract class QueryBuilder(
case n => b += " ELSE "; expr(n, b)
}
b += " END)"

// handle bizarre edge case where more than 1 If condition in a Case When statement
// *that uses String equality* results in a WrappedColumn (with parent as OperatorColumn)
// rather than the OperatorColumn itself
case x: WrappedColumn[_] if x.parent.isInstanceOf[OperatorColumn[_]] => show(x.parent, b)
case _: OperatorColumn[_] | _: WrappedColumn[_] =>
}
}

0 comments on commit 6866a21

Please sign in to comment.