mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

Some/Option from ResultSet with NULLABLE columns #160

Closed hohl closed 8 years ago

hohl commented 8 years ago

How to I read columns from ResultSets which I expect to be empty (NULL)? Something like row("column").asInstanceOf[Option[String]] doesn't work.

mauricio commented 8 years ago

@hohl they just return null if the value is null, no transformation is performed here.

fwbrasil commented 8 years ago

@hohl you probably want to use Option(row("column").asInstanceOf[String]) if you know that the column is nullable.

epifab commented 7 years ago

how about numeric values? row("column").asInstanceOf[Double] will give me 0.0