com.softinio.duck4s.algebra.BatchBinder
See theBatchBinder companion object
Type class for binding batch parameters to prepared statements.
This type class provides a way to bind different types of parameter values to prepared statements in a type-safe manner. Implementations are provided for tuples of various sizes, allowing batch operations with multiple parameters.
Type parameters
- T
-
the type of parameter values to bind
Attributes
- See also
-
ParameterBinder for individual parameter binding
- Since
-
0.1.0
- Example
-
// Custom binder for a case class case class User(name: String, age: Int) given BatchBinder[User] with def bind(stmt: DuckDBPreparedStatement, values: User*): Either[DuckDBError, Unit] = if (values.isEmpty) Right(()) else val user = values.head for { _ <- stmt.setString(1, user.name) _ <- stmt.setInt(2, user.age) } yield ()
- Companion
- object
- Graph
-
- Supertypes
Members list
In this article