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

fix: Handle nullable enums #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: Handle nullable enums #27

wants to merge 1 commit into from

Conversation

Piszmog
Copy link

@Piszmog Piszmog commented Jan 23, 2025

When an enum is nullable, update the kotlin code to handle those cases.

Fixes: #26

Details

  • When accessing the value of a nullable enum function parameter, use ?. instead of .. Using . is a compile error
  • When looking up the enum value from a string, since the column is nullable, getString(..) can return null. Update lookup(..) to allow null values.
  • If the enum lookup returns a null value, do not use !! on it

Appendix

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

Successfully merging this pull request may close these issues.

Nullable Postgres Enum fails to compile and nullpointers
1 participant