-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
column[Option[JsValue]] read null when Option is None #297
Comments
Well, the null default mechanism was already discarded by slick. So we'd better remove it too. |
Removed null default in 7d4b0dd. |
Thanks! |
Suffering this... Is there a version where this' been already fixed? |
@caeus the removing change was released in slick-pg v0.15.0-M2, you can try it. |
Hi there @tminglei, Do you have any plan to backport the patch to 0.14.x? v0.15.0-M3 is pre-release and it requires updating slick version to v3.2.0-M2 as well. |
Hi @haya14busa, no plan to backport to slick-pg 0.14.x, since zero value is an built-in mechanism before slick v3.2.0, and slick-pg followed that for a long time. |
Thank you for the reply. Hmm... ok I understood. I'll deal with the problem by defining wrapper trait of PlayJsonImplicits to make |
I have figured out that this problem is due to
And I've changed the
zero = JsNull
tozero = null
then my old code work. It is because when get across null value from database, slick-pg will consider it as JsNull, which is not a null value, so Option will have Some(JsNull). After that, JsNull in Some is transferred to null, so we've got Some(null) problem, which is really inconvenient for us to handle. Hope this could be fix. Thx.The text was updated successfully, but these errors were encountered: