ParameterBinder

com.softinio.duck4s.algebra.ParameterBinder
See theParameterBinder companion trait

Companion object providing implicit ParameterBinder instances for common types.

This object contains given instances for primitive types (Int, Long, Double, String, Boolean) and Option types, providing automatic parameter binding for these common cases.

Attributes

Since

0.1.0

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

Implicit ParameterBinder for BigDecimal values.

Implicit ParameterBinder for BigDecimal values.

Attributes

Since

0.1.4

Example
batch.addBatch((BigDecimal("123.45"), "item"))
Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for Boolean values.

Implicit ParameterBinder for Boolean values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product A", true)) // true for active
Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for Array[Byte] values (BLOB columns).

Implicit ParameterBinder for Array[Byte] values (BLOB columns).

Attributes

Since

0.1.4

Supertypes
class Object
trait Matchable
class Any
Self type
object dateBinder extends ParameterBinder[Date]

Implicit ParameterBinder for java.sql.Date values.

Implicit ParameterBinder for java.sql.Date values.

Attributes

Since

0.1.4

Example
batch.addBatch((java.sql.Date.valueOf("2024-06-15"), "event"))
Supertypes
class Object
trait Matchable
class Any
Self type
dateBinder.type

Implicit ParameterBinder for Double values.

Implicit ParameterBinder for Double values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product", 19.99))
Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for Float values.

Implicit ParameterBinder for Float values.

Attributes

Since

0.1.4

Supertypes
class Object
trait Matchable
class Any
Self type
object intBinder extends ParameterBinder[Int]

Implicit ParameterBinder for Int values.

Implicit ParameterBinder for Int values.

Attributes

Since

0.1.0

Example
 // Used automatically in batch operations batch.addBatch(("Alice",
 25)) // 25 bound as Int 
Supertypes
class Object
trait Matchable
class Any
Self type
intBinder.type

Implicit ParameterBinder for java.time.LocalDate values.

Implicit ParameterBinder for java.time.LocalDate values.

Passed via setObject; DuckDB maps this to the DATE column type.

Attributes

Since

0.1.4

Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for java.time.LocalDateTime values.

Implicit ParameterBinder for java.time.LocalDateTime values.

Passed via setObject; DuckDB maps this to the TIMESTAMP column type.

Attributes

Since

0.1.4

Supertypes
class Object
trait Matchable
class Any
Self type
object longBinder extends ParameterBinder[Long]

Implicit ParameterBinder for Long values.

Implicit ParameterBinder for Long values.

Attributes

Since

0.1.0

Example
batch.addBatch((1234567890L, "data"))
Supertypes
class Object
trait Matchable
class Any
Self type
longBinder.type

Implicit ParameterBinder for java.time.OffsetDateTime values.

Implicit ParameterBinder for java.time.OffsetDateTime values.

Passed via setObject; DuckDB maps this to the TIMESTAMPTZ column type.

Attributes

Since

0.1.4

Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for String values.

Implicit ParameterBinder for String values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Alice", "Engineer"))
Supertypes
class Object
trait Matchable
class Any
Self type

Implicit ParameterBinder for java.sql.Timestamp values.

Implicit ParameterBinder for java.sql.Timestamp values.

Attributes

Since

0.1.4

Example
batch.addBatch((java.sql.Timestamp.valueOf("2024-01-01 12:00:00"), "event"))
Supertypes
class Object
trait Matchable
class Any
Self type
object uuidBinder extends ParameterBinder[UUID]

Implicit ParameterBinder for java.util.UUID values.

Implicit ParameterBinder for java.util.UUID values.

DuckDB supports UUID natively; this binder uses setObject to pass the UUID directly without string conversion.

Attributes

Since

0.1.4

Example
batch.addBatch((java.util.UUID.randomUUID(), "label"))
Supertypes
class Object
trait Matchable
class Any
Self type
uuidBinder.type

Givens

Givens

Implicit ParameterBinder for BigDecimal values.

Implicit ParameterBinder for BigDecimal values.

Attributes

Since

0.1.4

Example
batch.addBatch((BigDecimal("123.45"), "item"))

Implicit ParameterBinder for Boolean values.

Implicit ParameterBinder for Boolean values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product A", true)) // true for active

Implicit ParameterBinder for Array[Byte] values (BLOB columns).

Implicit ParameterBinder for Array[Byte] values (BLOB columns).

Attributes

Since

0.1.4

Implicit ParameterBinder for java.sql.Date values.

Implicit ParameterBinder for java.sql.Date values.

Attributes

Since

0.1.4

Example
batch.addBatch((java.sql.Date.valueOf("2024-06-15"), "event"))

Implicit ParameterBinder for Double values.

Implicit ParameterBinder for Double values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Product", 19.99))

Implicit ParameterBinder for Float values.

Implicit ParameterBinder for Float values.

Attributes

Since

0.1.4

Implicit ParameterBinder for Int values.

Implicit ParameterBinder for Int values.

Attributes

Since

0.1.0

Example
 // Used automatically in batch operations batch.addBatch(("Alice",
 25)) // 25 bound as Int 

Implicit ParameterBinder for java.time.LocalDate values.

Implicit ParameterBinder for java.time.LocalDate values.

Passed via setObject; DuckDB maps this to the DATE column type.

Attributes

Since

0.1.4

Implicit ParameterBinder for java.time.LocalDateTime values.

Implicit ParameterBinder for java.time.LocalDateTime values.

Passed via setObject; DuckDB maps this to the TIMESTAMP column type.

Attributes

Since

0.1.4

Implicit ParameterBinder for Long values.

Implicit ParameterBinder for Long values.

Attributes

Since

0.1.0

Example
batch.addBatch((1234567890L, "data"))

Implicit ParameterBinder for java.time.OffsetDateTime values.

Implicit ParameterBinder for java.time.OffsetDateTime values.

Passed via setObject; DuckDB maps this to the TIMESTAMPTZ column type.

Attributes

Since

0.1.4

given optionBinder[T](using binder: ParameterBinder[T]): optionBinder[T]

Implicit ParameterBinder for Option values.

Implicit ParameterBinder for Option values.

This binder handles nullable parameters by binding the wrapped value if present, or NULL if the Option is None.

Type parameters

T

the type of the wrapped value

Value parameters

binder

implicit ParameterBinder for the wrapped type T

Attributes

Returns

a ParameterBinder for Option[T]

Since

0.1.0

Example
 // Some values are bound normally, None becomes NULL batch.addBatch(
 ("Alice", Some(25)), // age = 25 ("Bob", None) // age = NULL ) 

Implicit ParameterBinder for String values.

Implicit ParameterBinder for String values.

Attributes

Since

0.1.0

Example
batch.addBatch(("Alice", "Engineer"))

Implicit ParameterBinder for java.sql.Timestamp values.

Implicit ParameterBinder for java.sql.Timestamp values.

Attributes

Since

0.1.4

Example
batch.addBatch((java.sql.Timestamp.valueOf("2024-01-01 12:00:00"), "event"))

Implicit ParameterBinder for java.util.UUID values.

Implicit ParameterBinder for java.util.UUID values.

DuckDB supports UUID natively; this binder uses setObject to pass the UUID directly without string conversion.

Attributes

Since

0.1.4

Example
batch.addBatch((java.util.UUID.randomUUID(), "label"))