Retrieves the 0-indexed index of the column with the given name.
Retrieves the 0-indexed index of the column with the given name.
the case sensitive name of the column.
Some(Int) if the column exists with the given name. Otherwise, None.
The values for this Row.
Retrieves the Value in the column with the given name.
Retrieves the Value in the column with the given name.
the case sensitive name of the column.
Some(Value) if the column exists with the given name. Otherwise, None.
Returns a BigDecimal
for the given column name,
or null
if the SQL value is NULL.
Returns a BigDecimal
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are NewDecimal
,
float
, or double
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a BigInt
for the given column name,
or null
if the SQL value is NULL.
Returns a BigInt
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, long
, or longlong
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a Java primitive boolean
for the given column name,
or false
if the SQL value is NULL.
Returns a Java primitive boolean
for the given column name,
or false
if the SQL value is NULL.
This is used for MySQL columns that are tiny
as boolean
is a synonym for that type.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
https://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html
Returns a Java primitive byte
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive byte
for the given column name,
or 0
if the SQL value is NULL.
This is used for MySQL columns that are tiny
and signed.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
Returns a Array[Byte]
for the given column name,
or null
if the SQL value is NULL.
Returns a Array[Byte]
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are tinyblob
,
mediumblob
, blob
, binary
, or varbinary
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
Returns a Java primitive double
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive double
for the given column name,
or 0
if the SQL value is NULL.
This can be used for MySQL columns that are float
or
double
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a Java primitive float
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive float
for the given column name,
or 0
if the SQL value is NULL.
This is used for MySQL columns that are float
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a BigDecimal
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a BigDecimal
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are NewDecimal
,
float
, or double
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a BigInt
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a BigInt
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, long
, or longlong
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a boxed Java Boolean
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Boolean
for the given column name,
or None
if the SQL value is NULL.
This is used for MySQL columns that are tiny
as boolean
is a synonym for that type.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
https://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html
Returns Some
of a boxed Java Byte
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Byte
for the given column name,
or None
if the SQL value is NULL.
This is used for MySQL columns that are signed and tiny
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
Returns Some
of an Array[Byte]
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of an Array[Byte]
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are tinyblob
,
mediumblob
, blob
, binary
, or varbinary
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
Returns Some
of a boxed Java Double
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Double
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are float
or
double
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
doubleOrZero(
Returns Some
of a boxed Java Float
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Float
for the given column name,
or None
if the SQL value is NULL.
This is used for MySQL columns that are float
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a boxed Java Integer
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Integer
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, or signed and long
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a java.sql.Date
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a java.sql.Date
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are date
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
javaSqlDateOrNull(
Read the value of MySQL json
column as Some(T)
or None
if the SQL value is NULL.
Read the value of MySQL json
column as Some(T)
or None
if the SQL value is NULL.
the case sensitive name of the column.
the objMapper
used to parse the json column value into type T
.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not MySQL json
type.
ValueSerializationException
if the MySQL json column value cannot be serialized as T
.
Returns Some
of a boxed Java Long
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Long
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, long
, or signed and longlong
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a boxed Java Short
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a boxed Java Short
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, or
signed and short
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of a String
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of a String
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are varchar
, string
, or varstring
,
Also supports tinyblob
, blob
, and mediumblob
if the field's charset
is not the binary charset.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns Some
of an java.sql.Timestamp
for the given column name,
or None
if the SQL value is NULL.
Returns Some
of an java.sql.Timestamp
for the given column name,
or None
if the SQL value is NULL.
This can be used for MySQL columns that are timestamp
or datetime
.
the case sensitive name of the column.
the TimeZone
used to parse the data.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
Retrieves the 0-indexed index of the column with the given name.
Retrieves the 0-indexed index of the column with the given name.
the case sensitive name of the column.
-1 if the column does not exist, otherwise the index of the column.
Returns a Java primitive int
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive int
for the given column name,
or 0
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, or signed and long
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a java.sql.Date
for the given column name,
or null
if the SQL value is NULL.
Returns a java.sql.Date
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are date
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Read the value of MySQL json
column as type T
or null
if the SQL value is NULL.
Read the value of MySQL json
column as type T
or null
if the SQL value is NULL.
the case sensitive name of the column.
the objMapper
used to parse the json column value into type T
.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not MySQL json
type.
ValueSerializationException
if the MySQL json column value cannot be serialized as T
.
Read the Array[Byte]
value of MySQL json
column or null
if the SQL value is NULL.
Read the Array[Byte]
value of MySQL json
column or null
if the SQL value is NULL.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not MySQL json
type.
Returns a Java primitive long
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive long
for the given column name,
or 0
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, short
,
int24
, long
, or signed and longlong
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a Java primitive short
for the given column name,
or 0
if the SQL value is NULL.
Returns a Java primitive short
for the given column name,
or 0
if the SQL value is NULL.
This can be used for MySQL columns that are tiny
, or
signed and short
.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a Java String
for the given column name,
or null
if the SQL value is NULL.
Returns a Java String
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are varchar
, string
, or varstring
,
Also supports tinyblob
, blob
, and mediumblob
if the field's charset
is not the binary charset.
the case sensitive name of the column.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not a supported type.
Returns a java.sql.Timestamp
for the given column name,
or null
if the SQL value is NULL.
Returns a java.sql.Timestamp
for the given column name,
or null
if the SQL value is NULL.
This can be used for MySQL columns that are timestamp
or datetime
.
the case sensitive name of the column.
the TimeZone
used to parse the data.
ColumnNotFoundException
if the column is not found in the row.
UnsupportedTypeException
if the MySQL column is not that type.
A
Row
allows you to extract Value's from a MySQL row.Column values can be accessed by the MySQL column name via the typed
xyzOrNull
andgetXyz
methods. For example,stringOrNull
andgetString
. Theget
-prefixed methods returnOptions
and useNone
to represent a SQL NULL. For SQL NULLs, theor
-suffixed methods returnnull
for Object-types and use a sentinel, like 0, for primitives.Alternatively, Value's based on the column name can be accessed via the
apply
method.For example, given the query,
SELECT 'text' AS str_col, 123 AS int_col
, you could extract the columns as such.First, in Scala:
Then, the same in Java:
Client.cursor
Client.select
PreparedStatement.select