Skip to content

Commit

Permalink
Action sbt scalafmtAll
Browse files Browse the repository at this point in the history
  • Loading branch information
takapi327 committed Jan 3, 2025
1 parent 3a4fef9 commit 3f62695
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions module/ldbc-statement/src/main/scala/ldbc/statement/Delete.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

/**
Expand Down
16 changes: 8 additions & 8 deletions module/ldbc-statement/src/main/scala/ldbc/statement/Select.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down

0 comments on commit 3f62695

Please sign in to comment.