Skip to content

Commit

Permalink
Action sbt scalafmtAll
Browse files Browse the repository at this point in the history
  • Loading branch information
takapi327 committed May 26, 2024
1 parent 7944967 commit e3485aa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ case class CallableStatementImpl[F[_]: Temporal: Exchange: Tracer](
case q if q.startsWith("INSERT") =>
sendQuery(sql.split("VALUES").head + " VALUES" + args.mkString(","))
.flatMap {
case _: OKPacket => ev.pure(Array.fill(args.length)(Statement.SUCCESS_NO_INFO.toLong))
case _: OKPacket => ev.pure(Array.fill(args.length)(Statement.SUCCESS_NO_INFO.toLong))
case error: ERRPacket => ev.raiseError(error.toException("Failed to execute query", sql))
case _: EOFPacket => ev.raiseError(new SQLException("Unexpected EOF packet"))
case _: EOFPacket => ev.raiseError(new SQLException("Unexpected EOF packet"))
}
case q if q.startsWith("update") || q.startsWith("delete") || q.startsWith("CALL") =>
protocol.resetSequenceId *>
Expand Down Expand Up @@ -249,7 +249,7 @@ case class CallableStatementImpl[F[_]: Temporal: Exchange: Tracer](
ev.raiseError(
new SQLException("The batch query must be an INSERT, UPDATE, or DELETE, CALL statement.")
)
)
)
}
} <* params.set(ListMap.empty) <* batchedArgs.set(Vector.empty)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ case class ClientPreparedStatement[F[_]: Temporal: Exchange: Tracer](
Attribute("execute", "batch"),
Attribute("size", args.length.toLong),
Attribute("sql", args.toArray.toSeq)
)) *
))*
) *> (
if args.isEmpty then ev.pure(Array.empty)
else
Expand All @@ -188,11 +188,11 @@ case class ClientPreparedStatement[F[_]: Temporal: Exchange: Tracer](
protocol
.receive(GenericResponsePackets.decoder(protocol.initialPacket.capabilityFlags))
.flatMap {
case _: OKPacket => ev.pure(Array.fill(args.length)(Statement.SUCCESS_NO_INFO.toLong))
case _: OKPacket => ev.pure(Array.fill(args.length)(Statement.SUCCESS_NO_INFO.toLong))
case error: ERRPacket => ev.raiseError(error.toException("Failed to execute query", sql))
case _: EOFPacket => ev.raiseError(new SQLException("Unexpected EOF packet"))
case _: EOFPacket => ev.raiseError(new SQLException("Unexpected EOF packet"))
}
)
)
}
} <* params.set(ListMap.empty) <* batchedArgs.set(Vector.empty)
case q if q.startsWith("update") || q.startsWith("delete") =>
Expand Down Expand Up @@ -235,7 +235,7 @@ case class ClientPreparedStatement[F[_]: Temporal: Exchange: Tracer](
yield result
}
.map(_.toArray)
)
)
}
} <*
protocol.resetSequenceId <*
Expand All @@ -246,7 +246,7 @@ case class ClientPreparedStatement[F[_]: Temporal: Exchange: Tracer](
ev.raiseError(
new IllegalArgumentException("The batch query must be an INSERT, UPDATE, or DELETE statement.")
)
)
)

override def getGeneratedKeys(): F[ResultSet[F]] =
autoGeneratedKeys.get.flatMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ case class ServerPreparedStatement[F[_]: Temporal: Exchange: Tracer](
case error: ERRPacket => ev.raiseError(error.toException("Failed to execute query", sql))
case _: EOFPacket => ev.raiseError(new SQLException("Unexpected EOF packet"))
}
)
)
}
} <* params.set(ListMap.empty) <* batchedArgs.set(Vector.empty)
case q if q.startsWith("update") || q.startsWith("delete") =>
Expand Down Expand Up @@ -220,7 +220,7 @@ case class ServerPreparedStatement[F[_]: Temporal: Exchange: Tracer](
yield result
}
.map(_.toArray)
)
)
}
} <*
protocol.resetSequenceId <*
Expand All @@ -231,7 +231,7 @@ case class ServerPreparedStatement[F[_]: Temporal: Exchange: Tracer](
ev.raiseError(
new IllegalArgumentException("The batch query must be an INSERT, UPDATE, or DELETE statement.")
)
)
)

override def getGeneratedKeys(): F[ResultSet[F]] =
autoGeneratedKeys.get.flatMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ private[ldbc] case class StatementImpl[F[_]: Temporal: Exchange: Tracer](
yield result
}
.map(_.toArray)
)
)
}
} <* protocol.resetSequenceId <* protocol.comSetOption(
EnumMySQLSetOption.MYSQL_OPTION_MULTI_STATEMENTS_OFF
) <* clearBatch()
EnumMySQLSetOption.MYSQL_OPTION_MULTI_STATEMENTS_OFF
) <* clearBatch()

override def getGeneratedKeys(): F[ResultSet[F]] =
autoGeneratedKeys.get.flatMap {
Expand Down

0 comments on commit e3485aa

Please sign in to comment.