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

LazyId should be splitted into null and non-null variants #9

Closed
a-vezzoli-02 opened this issue Jun 3, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@a-vezzoli-02
Copy link
Member

a-vezzoli-02 commented Jun 3, 2022

Is your feature request related to a problem? Please describe.
Always have to check if the value of a LazyId is null or not makes the code "heavy". Also there are cases where a LazyId cannot have a null value (for example when a foreign key has a NON NULL)

Describe the solution you'd like
Splitting the LazyId class into different classes:

  • a generic one (the current LazyId)
  • a null one
  • a non-null one

Note that LazyId would then become a sealed class and the variants would be subclasses.

Describe alternatives you've considered
Probably also splitting the non-null variant into:

  • a non-null lazy one
  • a non-null defined one

could be useful

Additional context
No.

@a-vezzoli-02 a-vezzoli-02 added the enhancement New feature or request label Jun 3, 2022
@a-vezzoli-02 a-vezzoli-02 added this to the 0.1.3 milestone Jun 3, 2022
@a-vezzoli-02 a-vezzoli-02 self-assigned this Jun 3, 2022
@a-vezzoli-02
Copy link
Member Author

This is not fully doable. What can be done is to make LazyId always return non-null values. In this scenario, LazyId itself would be null.
This way the "null-check" will be necessary only if the value of the Table could be null, thus reducing the needing for "null-checking" even if the value could never be null.

@a-vezzoli-02 a-vezzoli-02 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant