Skip to content
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

InsertResult to return the primary key's type #117

Merged
merged 15 commits into from
Sep 3, 2021
Merged

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented Aug 29, 2021

Resolve #103

Special thanks to @acidic9 for providing inspiration on PR #112

@billy1624 billy1624 self-assigned this Aug 29, 2021
src/executor/execute.rs Outdated Show resolved Hide resolved
src/executor/insert.rs Outdated Show resolved Hide resolved
@billy1624
Copy link
Member Author

If this passes all tests, I will start re-think about all these trait bounds

pub trait PrimaryKeyTrait: IdenStatic + Iterable {
type ValueType: Sized
+ Default
+ Debug
+ Display
+ PartialEq
+ IntoValueTuple
+ TryGetable
+ FromStr;

@billy1624
Copy link
Member Author

billy1624 commented Aug 29, 2021

@billy1624
Copy link
Member Author

billy1624 commented Aug 29, 2021

Why I got this error again?
https://github.com/SeaQL/sea-orm/runs/3454985766?check_suite_focus=true#step:6:104

Okay, it was solved on 4d0c5f0

@tyt2y3 tyt2y3 force-pushed the master branch 2 times, most recently from 20580c3 to 8ce4b0a Compare August 29, 2021 19:33
@tyt2y3
Copy link
Member

tyt2y3 commented Aug 30, 2021

We need a trait TryFromU64 to replace the use of FromStr

@tqwewe
Copy link
Contributor

tqwewe commented Aug 30, 2021

We need a trait TryFromU64 to replace the use of FromStr

How would TryFromU64 work with something like UUID? I don't think postgres returns UUID as an integer does it?

@tyt2y3
Copy link
Member

tyt2y3 commented Aug 31, 2021

I think the Postgres side will fairly ignore that. We were only trying to fix the MySQL side.

@tyt2y3 tyt2y3 force-pushed the master branch 3 times, most recently from 2d2fff7 to 6847dab Compare August 31, 2021 08:02
@billy1624
Copy link
Member Author

Wow the commit hash starts with 0e0ee0e lolll

@tqwewe
Copy link
Contributor

tqwewe commented Sep 1, 2021

I'm curious why the trait TryFromU64 is added instead of using From<u64> or TryFrom<u64> 🤔
It seems like this might cover cases for libraries with types that already implement From<u64> / TryFrom<u64>
Sorry if this has already been discussed

@billy1624
Copy link
Member Author

I'm curious why the trait TryFromU64 is added instead of using From<u64> or TryFrom<u64> 🤔
It seems like this might cover cases for libraries with types that already implement From<u64> / TryFrom<u64>
Sorry if this has already been discussed

I think what we have here is not an usual logic of From<u64> or TryFrom<u64>. So, we better not use the conventional std traits.

src/executor/query.rs Show resolved Hide resolved
src/tests_cfg/cake_filling_price.rs Show resolved Hide resolved
@billy1624 billy1624 marked this pull request as ready for review September 2, 2021 08:51
@tyt2y3 tyt2y3 merged commit 76596da into master Sep 3, 2021
@tyt2y3 tyt2y3 deleted the primary-key-type branch September 3, 2021 06:15
arpancodes pushed a commit to arpancodes/sea-orm that referenced this pull request Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InsertResult to return the primary key's type
3 participants