Replies: 1 comment 3 replies
-
Hi @alephao, yeah this is a great thing we would love to support. We've been thinking that |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying out the library and came across a use-case that seem to be generic enough that might be worth adding to the library:
Let's say I have a table with a default value:
and the swift type would be:
The Draft API is a pretty nice way to insert a row on this table, but at the moment I need to pass a
Date
like so:Would be great if I could annotate the property so the
createdAt
becomes optional onMyTable.Draft
, similar to the@Column(primaryKey: true)
macro. So I can use it like so:One idea is to extend the
@Column
to accept a boolean and use it to decide if the generated property on Draft is optional or not, e.g.:hasDefault: Bool
oroptionalDraft: Bool
. Then we can use it like so:Let me know what you think, I'm happy to work on it and send a PR if you think that fits in the library scope.
Beta Was this translation helpful? Give feedback.
All reactions