Replies: 1 comment 1 reply
-
Generally speaking, people should use the first variant, it's the same with FK as PK, you also need to use the relation decorator with
That would mean we also allow array PKs which we surely don't and won't. I am not completely opposed to adding the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now, if you have a primary key property that is also an enum (be it the sole PK, or, more realistically, as part of a composite PK), you can only declare it via
@Enum({ items: () => EnumItems, primary: true });
Whereas
@PrimaryKey({ items: () => EnumItems });
Fails with a type error, since "items" is only defined in
@Enum
.Should
PrimaryKeyOptions
be modified to inherit fromEnumOptions
instead ofPropertyOptions
maybe?I found this by running the entity generator, which generates the second snippet... I'm wondering whether to try and fix that to be the first snippet... Or maybe change the decorator, so that the second snippet, as already generated, becomes working.
Beta Was this translation helpful? Give feedback.
All reactions