Parses column as array.
Parses column as array.
val a: Array[String] = SQL"SELECT str_arr FROM tbl".as(scalar[Array[String]]) }}}
Column conversion to big integer.
Column conversion to big integer.
import anorm.SqlParser.scalar import anorm.Column.columnToBigInt val c: BigInt = SQL("SELECT COUNT(*) FROM tbl").as(scalar[BigInt].single)
Column conversion to Java big integer.
Column conversion to Java big integer.
import anorm.SqlParser.scalar import anorm.Column.columnToScalaBigInteger val c: BigInteger = SQL("SELECT COUNT(*) FROM tbl").as(scalar[BigInteger].single)
Column conversion to bytes array.
Column conversion to bytes array.
import anorm.SqlParser.scalar import anorm.Column.columnToByteArray val bytes: Array[Byte] = SQL("SELECT bin FROM tbl"). as(scalar[Array[Byte]].single)
Column conversion to character.
Column conversion to character.
import anorm.SqlParser.scalar import anorm.Column.columnToChar val c: Char = SQL("SELECT char FROM tbl").as(scalar[Char].single)
Parses column as Java Date.
Parses column as Java Date. Time zone offset is the one of default JVM time zone (see java.util.TimeZone.getDefault).
import java.util.Date val d: Date = SQL("SELECT last_mod FROM tbl").as(scalar[Date].single)
Column conversion to bytes array.
Column conversion to bytes array.
import anorm.SqlParser.scalar import anorm.Column.columnToInputStream val bytes: InputStream = SQL("SELECT bin FROM tbl"). as(scalar[InputStream].single)
Column conversion to Java big decimal.
Column conversion to Java big decimal.
import java.math.{ BigDecimal => JBigDecimal } import anorm.SqlParser.scalar import anorm.Column.columnToJavaBigDecimal val c: JBigDecimal = SQL("SELECT COUNT(*) FROM tbl").as(scalar[JBigDecimal].single)
Parses column as joda DateTime
Parses column as joda DateTime
import org.joda.time.DateTime val d: Date = SQL("SELECT last_mod FROM tbl").as(scalar[DateTime].single)
Parses column as joda Instant
Parses column as joda Instant
import org.joda.time.Instant val d: Date = SQL("SELECT last_mod FROM tbl").as(scalar[Instant].single)
Parses column as list.
Parses column as list.
val a: List[String] = SQL"SELECT str_arr FROM tbl".as(scalar[List[String]]) }}}
Column conversion to big decimal.
Column conversion to big decimal.
import anorm.SqlParser.scalar import anorm.Column.columnToScalaBigDecimal val c: BigDecimal = SQL("SELECT COUNT(*) FROM tbl").as(scalar[BigDecimal].single)
Helper function to implement column conversion.
Helper function to implement column conversion.
Function converting raw value of column
(Since version 2.3.6) Use nonNull1
Column companion, providing default conversions.