DbResultReader

zio.blocks.sql.DbResultReader

Reads column values from a database result set.

All index parameters are 1-based (JDBC convention). Label-based access is available for order-independent decoding. After any get* call, use wasNull to check whether the value was SQL NULL.

Attributes

Source
DbCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def columnLabel(index: Int): String

Attributes

Source
DbCodec.scala
def getBigDecimal(index: Int): BigDecimal

Attributes

Source
DbCodec.scala
def getBigDecimal(label: String): BigDecimal

Attributes

Source
DbCodec.scala
def getBoolean(index: Int): Boolean

Attributes

Source
DbCodec.scala
def getBoolean(label: String): Boolean

Attributes

Source
DbCodec.scala
def getByte(index: Int): Byte

Attributes

Source
DbCodec.scala
def getByte(label: String): Byte

Attributes

Source
DbCodec.scala
def getBytes(index: Int): Array[Byte]

Attributes

Source
DbCodec.scala
def getBytes(label: String): Array[Byte]

Attributes

Source
DbCodec.scala
def getDouble(index: Int): Double

Attributes

Source
DbCodec.scala
def getDouble(label: String): Double

Attributes

Source
DbCodec.scala
def getDuration(index: Int): Duration

Attributes

Source
DbCodec.scala
def getDuration(label: String): Duration

Attributes

Source
DbCodec.scala
def getFloat(index: Int): Float

Attributes

Source
DbCodec.scala
def getFloat(label: String): Float

Attributes

Source
DbCodec.scala
def getInstant(index: Int): Instant

Attributes

Source
DbCodec.scala
def getInstant(label: String): Instant

Attributes

Source
DbCodec.scala
def getInt(index: Int): Int

Attributes

Source
DbCodec.scala
def getInt(label: String): Int

Attributes

Source
DbCodec.scala
def getLocalDate(index: Int): LocalDate

Attributes

Source
DbCodec.scala
def getLocalDate(label: String): LocalDate

Attributes

Source
DbCodec.scala
def getLocalDateTime(index: Int): LocalDateTime

Attributes

Source
DbCodec.scala
def getLocalDateTime(label: String): LocalDateTime

Attributes

Source
DbCodec.scala
def getLocalTime(index: Int): LocalTime

Attributes

Source
DbCodec.scala
def getLocalTime(label: String): LocalTime

Attributes

Source
DbCodec.scala
def getLong(index: Int): Long

Attributes

Source
DbCodec.scala
def getLong(label: String): Long

Attributes

Source
DbCodec.scala
def getShort(index: Int): Short

Attributes

Source
DbCodec.scala
def getShort(label: String): Short

Attributes

Source
DbCodec.scala
def getString(index: Int): String

Attributes

Source
DbCodec.scala
def getString(label: String): String

Attributes

Source
DbCodec.scala
def getUUID(index: Int): UUID

Attributes

Source
DbCodec.scala
def getUUID(label: String): UUID

Attributes

Source
DbCodec.scala
def hasColumn(label: String): Boolean

Attributes

Source
DbCodec.scala
def wasNull: Boolean

Attributes

Source
DbCodec.scala

Concrete methods

def getArray(index: Int): Array[String]

Reads the array column at the given 1-based index as a flat Array[String].

Reads the array column at the given 1-based index as a flat Array[String].

Attributes

Returns

the column's elements; a SQL NULL array decodes to null

Throws
UnsupportedOperationException

by default — only backends with native array support override this

Source
DbCodec.scala
def getArray(label: String): Array[String]

Reads the array column named label as a flat Array[String].

Reads the array column named label as a flat Array[String].

Attributes

Returns

the column's elements; a SQL NULL array decodes to null

Throws
UnsupportedOperationException

by default — only backends with native array support override this

Source
DbCodec.scala
def isNull(index: Int): Boolean

Returns true if the column at the given 1-based index contains SQL NULL in the current row.

Returns true if the column at the given 1-based index contains SQL NULL in the current row.

Only backends that carry an out-of-band null bitmap can answer reliably before the column is decoded (a wire-protocol backend reads NULL flags from the row header). The JDBC backend records wasNull as each getter runs, so its answer is only meaningful after that column has been read; before the first read it reports false. The default reports false, which preserves the historical behavior: Option/Maybe codecs then fall back to the post-read wasNull check and decode the inner value as before.

Value parameters

index

the 1-based column position

Attributes

Returns

true if the backend knows the column is NULL; false when it is non-null or not yet known — callers must treat false as "unknown", never as a confirmed non-null

Source
DbCodec.scala
def isNull(label: String): Boolean

Label-based variant of isNull.

Label-based variant of isNull.

Value parameters

label

the result-set column label

Attributes

Returns

true if the backend knows the named column is NULL; false when it is non-null or not yet known (see isNull(index:Int) for the per-backend reliability contract)

Source
DbCodec.scala