-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Upgrade to SQLAlchemy 2 #1269
base: master
Are you sure you want to change the base?
Upgrade to SQLAlchemy 2 #1269
Conversation
CodSpeed Performance ReportMerging #1269 will degrade performances by 38.25%Comparing Summary
Benchmarks breakdown
|
I know that we use |
Yep, I haven't updated Poetry yet since I'm still waiting on databases to make a release. I can update it to point at their GitHub for now if you just want to see it pass. Databases has now also dropped support for 3.7, should I do that as well as part of this PR? It was a lot less changes than I was expecting too lol, I guess databases just bears most of the work for this. |
I can wait for the release, they just did 0.9.0 bit not sure if your change was included, guess so as it was merged |
Oh yeah 0.9 should be good, I'll finish this up soon then |
@collerek We need to remove 3.7 support in order to merge this, should I make another PR to do that? We might want to add 3.12 too while we're at it |
You can remove it here, it's removed in pydantic v2 pr already |
BTW it seems like a significant performance degradation over the previous version, we need to check if caching is working as described here: https://docs.sqlalchemy.org/en/20/faq/performance.html |
How can I and/or others help? I just don't want to step on anyone's toes. |
Sorry, I'm going to try to come back around to this soon. I think there's a single PostgreSQL test that is failing still and there are the performance problems mentioned by collerek earlier. If you want, you can fork my branch and send a PR for me to merge into this one. Let me know if you want to try and tackle one of those, thanks for the help! |
I'll take a look, I still don't know if I have enough expertise to actually do something useful. If I find something, you'll get PR, of course. |
@pmdevita I was at liberty to cherry-pick your changes onto master branch and create feature/sqlalchemy2. On my machine testing signals fails, but I'll leave that for later. I'll try to find what's going on with performance, first. |
I did get |
I don't just want to sell out on the databases project... but its not getting a lot of support these days, and SQLAlchemy 2.0 does support async on its own now. I don't really know that much about Ormar's internals but is it worth cutting out the middle man and just working with SQLAlchemy directly? |
Well I went and dug a bit myself, looks like we only use the databases library to execute SQLAlchemy expressions asynchronously in QuerySet, which is very possible now in SQLAlchemy 2. There would be some public API changes since we'd no longer use databases to create the DB connection, but it doesn't seem like it would be a huge hassle and we'd benefit by not having to worry about the state of the databases library. Do you have any thoughts @collerek? |
#1177
select()
now take multiple params rather than a collection