-
Notifications
You must be signed in to change notification settings - Fork 2
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 SQLAlchemy dialect with psycopg2 #100
Comments
I think the sqlalchemy dialect doesn't have too many concrete dependencies on crate-python. One exception from the client is used: https://github.com/crate/crate-python/blob/f2617dd789f0eb70b042ac77be4b7c8bd936a7c6/src/crate/client/sqlalchemy/dialect.py#L34 but I don't think that's a real issue. We could also consider to de-couple it completely, but not sure what's the benefit of using psycopg2 over the crate-python http based client? We also have to keep in mind that psycopg2 is LGPL licensed, which is afaik not compatible with Apache licensed projects. So we wouldn't be able to ship anything with psycopg2 included. |
Hi Mathias, thanks for looking into this. I was just trying to figure out if there are any other intrinsic couplings which would prevent this in general. I would not de-couple it but instead provide an option to invoke it like outlined at [1].
Wouldn't the communication be a bit more efficient regarding binary serialization on the wire and without the overhead of HTTP? Also, things like how to properly configure a shared connection pool (#90) would not need any special attention.
Thanks for bringing that up. SQLAlchemy is MIT licensed and references With kind regards, [1] https://docs.sqlalchemy.org/en/13/core/engines.html#postgresql |
The PostgreSQL wire communication supports text and binary serialization. I think
Yes it works as optional dependency. I think the license only prevents us from providing a bundle that would include psycopg2 code out of the box. |
SQLAlchemy 1.4 also supports asyncpg. I think that may be more worthwhile to support than psycopg2 as it has performance advantages. |
Hi again, I fully agree that the focus should be on asyncpg instead. I will add a corresponding test case to crate/crate-python#391 and close this issue. Feel free to reopen or create another one as soon as psycopg3 is ready and qualifies further evaluation. With kind regards, |
Hi there,
coming from orchestracities/ngsi-timeseries-api#407 (comment), I am asking myself whether it would be possible to use the CrateDB SQLAlchemy dialect together with the Python DB API 2.0 compatible
psycopg2
driver.Maybe @mfussenegger, @chaudum or @autophagy can add a comment about this?
With kind regards,
Andreas.
The text was updated successfully, but these errors were encountered: