Skip to content

Commit

Permalink
Delete Product param
Browse files Browse the repository at this point in the history
  • Loading branch information
takapi327 committed Dec 31, 2024
1 parent 010b5a8 commit 9e3d768
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/ldbc-dsl/src/main/scala/ldbc/dsl/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ package object dsl:
// see: https://github.com/tpolecat/doobie/blob/main/modules/core/src/main/scala/doobie/util/fragments.scala

/** Returns `VALUES (v0, v1), (v2, v3), ...`. */
def values[M[_]: Reducible, T <: Product](vs: M[T])(using Encoder[T]): Mysql[F] =
sql"VALUES" ++ comma(vs.toNonEmptyList.map(v => parentheses(values[T](v))))
def values[M[_]: Reducible, T](vs: M[T])(using Encoder[T]): Mysql[F] =
sql"VALUES" ++ comma(vs.toNonEmptyList.map(v => parentheses(values(v))))

private def values[T <: Product](v: T)(using encoder: Encoder[T]): Mysql[F] =
private def values[T](v: T)(using encoder: Encoder[T]): Mysql[F] =
val params = Parameter.Dynamic.many(encoder.encode(v))
Mysql[F](List.fill(params.size)("?").mkString(","), params)

Expand Down

0 comments on commit 9e3d768

Please sign in to comment.