-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Backend for async SQLAlchemy ORM #121
base: master
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/flortz/fastapi-crudrouter/EAS4myHY5LcKjZqzoaV1XjS28kmP |
Wow, I was just working on this myself after abandoning ormar in favor of using async sqlalchemy but yours looks great and I hope it is merged quickly. |
Hi @il-s thanks for this! Sorry for the delay, I've been quite busy. I am totally on board with adding support for this, however I have a couple questions:
Thanks again for this 🚀 |
@awtkns |
for the test, I used db_func like so:
` |
@awtkns, need review! |
…alse: not; None: autodetect)
HI @il-s, looking good! I am hoping to get this in and released tomorrow! I just need to add it to the test framework and write some documentation for it 🚀 |
@awtkns |
Hi @awtkns , any status on this? |
try: | ||
(model,) = ( | ||
await db.execute( | ||
select(self.db_model).where(self.db_model.id == item_id) |
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.
Just fyi... my team noticed this doesn't work with PK's not named "id". I think this code might work better:
select(self.db_model).where(self.db_model.id == item_id) | |
select(self.db_model).where(getattr(self.db_model, self._pk) == item_id) |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Any updates?
Hi, I liked the idea of your project and needed to make a fastapi router that will work with SQLAlchemy in asynchronous mode.
Also this answers issue number #87