BatchBinder

com.softinio.duck4s.algebra.BatchBinder
See theBatchBinder companion object
trait BatchBinder[T]

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
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def bind(stmt: DuckDBPreparedStatement, values: T*): Either[DuckDBError, Unit]

Binds parameter values to a prepared statement.

Binds parameter values to a prepared statement.

Value parameters

stmt

the prepared statement to bind parameters to

values

the parameter values to bind

Attributes

Returns

Right(()) on success, Left(DuckDBError) on failure