-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Returning #292
Conversation
billy1624
commented
Nov 5, 2021
•
edited
Loading
edited
- Resolve Support returning clause to avoid database hits #183
Hey @tyt2y3, checkout the support of returning for Postgres. |
Got this error on MariaDB 10.5+
|
Now I'm stuck on the SQLx problem... I'm thinking maybe we just support returning for Postgres at this stage. We can leave MariaDB & Sqlite as-is, i.e. one more round trip per insert / update, if it involve updating sqlx-core. |
The issue not only affecting MariaDB 10.5+ but SQLite 3.35.0+ |
Just open another issue on SQLx |
As discussed, we would only support |
Ready for review & merge @tyt2y3 |
let res = <Self::Entity as EntityTrait>::insert(am).exec(db).await?; | ||
let found = <Self::Entity as EntityTrait>::find_by_id(res.last_insert_id) | ||
.one(db) | ||
let am = <Self::Entity as EntityTrait>::insert(am) |
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.
SO we need new test cases here.
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.
Yep!
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.
Test cases added
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.
Nice
issues-280 Rewrite drivers to proc-macro