How to get a default value based on another column (and maybe the same column) #1302
Unanswered
OliverRhyme
asked this question in
Q&A
Replies: 1 comment 5 replies
-
|
Unfortunately, sqlite only supports constant values for defaults, so you can't use column values in defaults. I'm not aware of any moor api which could be used to model this either, so I think this impossible. Can you implement this check somewhere in your app before constructing the companion to insert? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, for example I have a table value named position (IntColumn), and I want its default value to be the max (or 0 if null) of the position column itself. I tried
withDefault(position.max())but it causes StackOverflowError.Maybe my implementation is wrong or maybe it is not currently possible. I want to know how to do it or possible workaround. Thank you
Beta Was this translation helpful? Give feedback.
All reactions