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

Support for SQLAlchemy Core #28

Closed
meitham opened this issue Oct 14, 2022 · 2 comments · Fixed by #29
Closed

Support for SQLAlchemy Core #28

meitham opened this issue Oct 14, 2022 · 2 comments · Fixed by #29
Labels
enhancement New feature or request

Comments

@meitham
Copy link

meitham commented Oct 14, 2022

Hi there,

Thank you for making this lovely library.

I currently use the AstToSqlAlchemyClauseVisitor which works well with SQLAlchemy ORM, but my application is async so I use sqlalchemy core everywhere apart from where OData is involved. My database does not support async driver so sqlalchemy 2.0 async support won't actually bring an difference to me. With sqlalchemy core I build the query statements and handle all aspects around execution of the statement myself with loop.run_in_executor, which again does not work well with ORM.

Would it possible to add support for sqlalchemy core?

@OliverHofkens
Copy link
Member

Hey, thanks for the kind words!

It would make a ton of sense to support SQLAlchemy Core, and judging from your PR (thanks a ton!) the implementation isn't even that different from the ORM. I'll try to review this today and get a release out ASAP.

@OliverHofkens OliverHofkens added the enhancement New feature or request label Oct 28, 2022
@OliverHofkens OliverHofkens linked a pull request Oct 28, 2022 that will close this issue
@OliverHofkens
Copy link
Member

Thanks for the contribution and feedback! I've merged the PR, done some minor refactoring, and updated the docs. This will be present in the v0.7.0 release, which would be released right now if PyPI wasn't in maintenance mode.

I couldn't find a clear way to get relationship traversal working in Core, so I added some warnings to the docs and NotImplementedErrors in the code. I created a follow-up ticket for that functionality: #32 .

Hopefully this works for your case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants