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
feat: add @AllowNull
, @AutoIncrement
, @Comment
, @Default
, @PrimaryKey
, and validation decorators
#15384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but wow this is some excellent code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two unused imports but no further new comments from my side. Looking really good and also some nice improvements on the hook decorators!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work
Thanks :) |
Pull Request Checklist
Description Of Change
I reworked our internal decorator utils to reduce duplication of code
This PR adds the following decorators:
A few differences with sequelize-typescript:
IsNull
has been removedNotNull
configures the "allowNull" option instead ofvalidation.notNull
. I've markedvalidation.notNull
andvalidation.isNull
for future removal, as it makes no sense to have three ways to validate whether something is or isn't nullValidate
has been renamed toValidateAttribute
Validator
has been renamed toModelValidator
ColumnName
as a more user friendly name thanfield
(until we renamefield
tocolumnName
)