Skip to content

Commit

Permalink
remove Setter.arraySetter
Browse files Browse the repository at this point in the history
I want to interpolate in postgres arrays as parameters - not explode them as multiple parameters.
  • Loading branch information
oyvindberg committed Oct 28, 2023
1 parent 95cf50f commit 1f7dfab
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions core/src/main/scala/zio/jdbc/SqlFragment.scala
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,6 @@ object SqlFragment {
implicit def vectorSetter[A](implicit setter: Setter[A]): Setter[Vector[A]] = iterableSetter[A, Vector[A]]
implicit def setSetter[A](implicit setter: Setter[A]): Setter[Set[A]] = iterableSetter[A, Set[A]]

implicit def arraySetter[A](implicit setter: Setter[A]): Setter[Array[A]] =
forSqlType(
(ps, i, iterable) =>
iterable.zipWithIndex.foreach { case (value, valueIdx) =>
setter.setValue(ps, i + valueIdx, value)
},
Types.OTHER
)

private def iterableSetter[A, I <: Iterable[A]](implicit setter: Setter[A]): Setter[I] =
forSqlType(
(ps, i, iterable) =>
Expand Down

0 comments on commit 1f7dfab

Please sign in to comment.