diff --git a/module/ldbc-schema/src/test/scala/ldbc/schema/TableQueryTest.scala b/module/ldbc-schema/src/test/scala/ldbc/schema/TableQueryTest.scala index d8cf85ce6..e35ae3591 100644 --- a/module/ldbc-schema/src/test/scala/ldbc/schema/TableQueryTest.scala +++ b/module/ldbc-schema/src/test/scala/ldbc/schema/TableQueryTest.scala @@ -438,7 +438,11 @@ class TableQueryTest extends AnyFlatSpec: it should "The delete query statement generated from Table is equal to the specified query statement." in { assert(query.delete.statement === "DELETE FROM test") assert(query.delete.where(_.p1 === 1L).statement === "DELETE FROM test WHERE test.p1 = ?") - assert(query.delete.whereOpt(test => Some(1L).map(v => test.p1 _equals v)).statement === "DELETE FROM test WHERE test.p1 = ?") + assert( + query.delete + .whereOpt(test => Some(1L).map(v => test.p1 _equals v)) + .statement === "DELETE FROM test WHERE test.p1 = ?" + ) assert( query.delete .whereOpt(Some(1L))((test, value) => test.p1 === value) diff --git a/module/ldbc-statement/src/main/scala/ldbc/statement/Delete.scala b/module/ldbc-statement/src/main/scala/ldbc/statement/Delete.scala index 024d69e36..c8953fbee 100644 --- a/module/ldbc-statement/src/main/scala/ldbc/statement/Delete.scala +++ b/module/ldbc-statement/src/main/scala/ldbc/statement/Delete.scala @@ -65,16 +65,16 @@ case class Delete[A]( func(table) match case Some(expression) => Where.C( - table = table, - statement = statement ++ s" WHERE ${expression.statement}", - params = params ++ expression.parameter + table = table, + statement = statement ++ s" WHERE ${ expression.statement }", + params = params ++ expression.parameter ) case None => Where.C( - table = table, + table = table, statement = statement, - params = params, - isFirst = true + params = params, + isFirst = true ) /** diff --git a/module/ldbc-statement/src/main/scala/ldbc/statement/Select.scala b/module/ldbc-statement/src/main/scala/ldbc/statement/Select.scala index 82c808895..c06f309df 100644 --- a/module/ldbc-statement/src/main/scala/ldbc/statement/Select.scala +++ b/module/ldbc-statement/src/main/scala/ldbc/statement/Select.scala @@ -78,18 +78,18 @@ case class Select[A, B]( func(table) match case Some(expression) => Where.Q[A, B]( - table = table, - columns = columns, - statement = statement ++ s" WHERE ${expression.statement}", - params = params ++ expression.parameter + table = table, + columns = columns, + statement = statement ++ s" WHERE ${ expression.statement }", + params = params ++ expression.parameter ) case None => Where.Q[A, B]( - table = table, - columns = columns, + table = table, + columns = columns, statement = statement, - params = params, - isFirst = true + params = params, + isFirst = true ) /** diff --git a/module/ldbc-statement/src/main/scala/ldbc/statement/Update.scala b/module/ldbc-statement/src/main/scala/ldbc/statement/Update.scala index 01c1ec2e2..db60b67f0 100644 --- a/module/ldbc-statement/src/main/scala/ldbc/statement/Update.scala +++ b/module/ldbc-statement/src/main/scala/ldbc/statement/Update.scala @@ -130,7 +130,7 @@ object Update: statement = statement ++ s" WHERE ${ expression.statement }", params = params ++ expression.parameter ) - + override def whereOpt(func: A => Option[Expression]): Where.C[A] = func(table) match case Some(expression) =>