-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
fix: Mark SQLite backend as "returning" #654
base: master
Are you sure you want to change the base?
Conversation
The RETURNING syntax has been supported by SQLite since version 3.35.0 (2021-03-12) and is modeled after PostgreSQL.
Tests are failing, there must be something more we need to do to support returning in SQLite |
@tyt2y3 weird, I remember tests passing locally. I will work some more on this. |
This is only for more recent versions of sqlite, possible that the version of sqlite used by the runner is too old. |
@Sytten Well, new as in since version 3.35.0 (2021-03-12). Should I put it behind a feature gate? I'm currently using Unsure if it's possible to get SQLite version at build time and conditionally enable that feature. |
Diesel uses a feature flag, so it might be a good idea since sea-orm is on a similar stack level (it would not make sense in sea-query). I checked the runner and it is using
|
Yep, GitHub Actions on Ubuntu 20.04 ships with SQLite 3.31. |
I think we want to always look forward. If support for that is universal (enough), we'd simply enable it without the possibility to turn it off. |
So the question is how universal is this support across major linux distros (for reference)? |
Quick glance: Ubuntu 22.04 LTS, Ubuntu 21.10, Debían testing, Fedora 35/36,
Alpine, nix stable, homebrew (macos) support it.
Couldn't find a CentOS version that does, but that's just CentOS-life. I
think this mostly effects CI builders since a lot of them use 20.04 release
as base.
Amazon Linux 2 doesn't, but that should affect no one. Not a jab at Amazon Linux, it just not used anywhere to build rust projects to my knowledge, it could be used to host containers that do, but not by itself.
…On Sun, Jul 10, 2022, 1:23 AM Chris Tsang ***@***.***> wrote:
So the question is how universal is this support across major linux
distros (for reference)?
—
Reply to this email directly, view it on GitHub
<#654 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABEFG574HAU5ZE5VG27T4DVTKCB3ANCNFSM5SG65HWQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This been assigned to me, but what's the consensus on this, so I know what to do next? |
I think that since we upgraded sqlx to 0.6 now, we if mark |
Well, the tests are failing because CI runner has old version of SQLite. I'll double check on my fork that embedded SQLite version works. I think if we don't hide behind feature flag, then using older version of SQLite should be a compile time error to prevent surprises at runtime. |
Hey @andoriyu, I think we can bump the OS version on GitHub Action to |
Sounds like a good plan |
This should bring a newer version of SQLite that supports `returning`
@tyt2y3 @billy1624 I've updated workflows that use SQLite to |
Hmmmm... the behaviour of SQLite changed in newer version?
https://github.com/SeaQL/sea-orm/runs/7606184783?check_suite_focus=true#step:5:671 |
@billy1624 related sqlx issue and SQLite forum post. It's a bug in SQLite that is fixed, but not in the version installed on runners 🤦♂️. I think it's passing on sqlx-vendored SQLite, that's what I used when I first opened this PR. |
Hey @andoriyu, can you try something on your machine? I can run But SeaORM test cases failed. Both are essentially the same: inserting a floating point number w/o decimal e.g. Why it can be run w/o error on SQLx but not SeaORM? |
I think it has been patched on SQLite long time ago and the patch should be included in SQLite version |
The RETURNING syntax has been supported by SQLite since version 3.35.0 (2021-03-12) and is modeled after PostgreSQL.
PR Info
Adds
Makes it possible to use
returning
branch in updates in inserts. The same way it's working in PostgreSQL.Fixes
Breaking Changes
No breaking changes.
Changes
Changes how update and insert behaves internally.