Skip to content
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

Support default values for fields of case classes #27

Open
mehakun opened this issue Sep 8, 2022 · 0 comments
Open

Support default values for fields of case classes #27

mehakun opened this issue Sep 8, 2022 · 0 comments

Comments

@mehakun
Copy link

mehakun commented Sep 8, 2022

Currently, if we perform read of row which contains null, while case class has default value, exception is raised.
I.e.

final case class Obj(userId: Int, userData: String = "data")
// we will receive record (123, null)
cqlt"select user_id, user_data from user_table".as[Obj]

But since cql does not support ifNull in quieries, having its emulation in scala code becomes quite handy and useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant