-
Notifications
You must be signed in to change notification settings - Fork 25
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: refactor type definitions to export SequelizeBone, complete spell type definitions and fix index hints logic #337
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ll type definitions and fix index hints logic
…tter cannot be serialize
JimmyDaddy
force-pushed
the
refactor/type_define_sequelize_adaptor
branch
from
August 28, 2022 12:35
9220259
to
41b94d6
Compare
JimmyDaddy
commented
Aug 29, 2022
const { columnName } = attributes[name]; | ||
if (!(columnName in row)) { | ||
const attribute = attributes[name]; | ||
if (!(attribute.columnName in row) && !attribute.virtual) { |
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.
virtual column should not be added to unset in case of custom getter cannot be serialize
class User {
@Column()
id: bigint;
// custom will be ignored when toObject()/toJSON() execute, so make it a VIRTUAL column
get custom(): string {
return 'v';
}
}
JimmyDaddy
commented
Aug 29, 2022
@@ -37,7 +37,7 @@ function findType(tsType) { | |||
} | |||
} | |||
|
|||
export function Column(options?: ColumnOption | DATA_TYPE<DataType>) { | |||
export function Column(options?: ColumnOption | DATA_TYPE<DataType> | DataType) { |
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.
class User {
// types invokable should work
@Column(DataTypes.STRING(12))
id: bigint;
}
JimmyDaddy
commented
Aug 29, 2022
JimmyDaddy
commented
Aug 29, 2022
cyjake
approved these changes
Aug 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SequelizeBone
for sequelize adaptor