Slick: Odd error when using .firstOption.get | [SlickException: Read NULL value (null) for ResultSet column Path s2._5] -
so have next code used validation method:
if (tablequery[userstable].filter(_.name === login).exists.run) { val id = tablequery[userstable].filter(_.name === login).firstoption.get.id val name = tablequery[userstable].filter(_.id === id).firstoption.get.name }
if you're wondering, check create sure of .exists before query next 2 times because login value can equal 2 columns in database.
anyways, [slickexception: read null value (null) resultset column path s2._5] when attempting id above, , i'm unsure why. there should first alternative there because code has validated row exists requirements typed beforehand. no "id" column values null.
how can id value working correctly?
one of involved columns nullable didn't specify option[...] in table.
slick
No comments:
Post a Comment