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.
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
Derive value type #1720
Derive value type #1720
Changes from 12 commits
5151bc7
e1f0183
ed72c41
2224121
a78a995
0bca42e
b612b19
37dab79
4a2219f
bd86566
c619f26
46e8b36
db6d57f
588000b
4620a90
12a7808
92bbf3b
3e4734f
75dd001
c663576
1278f18
9e3f726
c3fc4ab
6da5335
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The strange bit here is that the StringVec is not included in the Model for testing.
Albeit it only works on Postgres.
May be we can simply change the test case https://github.com/SeaQL/sea-orm/blob/master/tests/common/features/json_vec.rs, because now
DeriveValueType
is the new, recommended API.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.
Currently, the conversion of
DeriveValueType
rely on the pre-defined conversion from the field toValue
.I think
Vec<String>
currently does not have a defined conversion to any variant ofValue
, which I suppose it should.(in json_vec, it convert itself to formatted String as
Value
, which I suppose isn't a good generic approach)I'm wondering if I should implement
From<Vec<T>> for Value
or adjust theDeriveValueType
implementation only.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.
I see. Sadly then it means that we can't 'eat our own dog food' for this test case.
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.
Great work. I think it looks really good. One question, is
array_type
required here? What if we omit it?Can we actually change the test case in
tests/common/features/json_vec.rs
to use thisDeriveValueType
instead of the manual implementation?Just want to make sure we have had end to end tests.