ParameterBinder

com.softinio.duck4s.algebra.ParameterBinder
See theParameterBinder companion object
trait ParameterBinder[T]

Type class for binding individual parameters to prepared statements.

This type class provides a way to bind individual parameter values to prepared statements at specific parameter indexes. Implementations are provided for common Scala types and Option types.

Type parameters

T

the type of parameter value to bind

Attributes

See also

BatchBinder for batch parameter binding

Since

0.1.0

Example
 // Custom binder for a custom type case class UserId(value: Long)
given ParameterBinder[UserId] with def bind( stmt: DuckDBPreparedStatement,
index: Int, value: UserId ): Either[DuckDBError, Unit] = stmt.setLong(index,
value.value).map(_ => ()) 
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object booleanBinder
object bytesBinder
object dateBinder
object doubleBinder
object floatBinder
object intBinder
object longBinder
object stringBinder
object uuidBinder
Show all

Members list

Value members

Abstract methods

def bind(stmt: DuckDBPreparedStatement, index: Int, value: T): Either[DuckDBError, Unit]

Binds a parameter value to a prepared statement at the specified index.

Binds a parameter value to a prepared statement at the specified index.

Value parameters

index

the parameter index (1-based)

stmt

the prepared statement to bind the parameter to

value

the parameter value to bind

Attributes

Returns

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