You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please teach how to do Table(autoload=True) or metadata.reflect() with asyncpgsa properly.
Tried passing reflect(bind=asyncpgsa_connection) and it's AttributeError game: needs connect then dialect, I feel like it's going in wrong direction.
People use psycopg2 to create sqlalchemy engine and then async driver for normal work. That may work if reflection doesn't use driver specifics. I'll use that crutch if nothing else works.
Autoreflection/Engine are orm properties. As the readme states, this repo currently doesn't support orm properties, only query builder (SQLAlchemy Core). I am not opposed to having this library support it, it is just out of the scope for myself, as I do not use the ORM/Engine side of sqlalchemy. Would be interested in reviewing a PR that attempts to add this to the library however.
Ok, yes, you are right, this is part of the "core" functionality section. And the fact that it just loads a table does make it core. Either way, today, the "engine" abstraction has yet to be implemented. Would be open to someone doing it.
I will do it but need a bit guidance. Do you know what exactly needs to be implemented: Engine or Connectable wrapper for SAConnection or CreateEnginePlugin or something else?
It seems sqlalchemy 1.4+ can be run without asyncpgsa altogether, but there is no shortage of issues reported and my task is overdue, so using psycopg2 for reflection so far. I'll post updates here.
Activity
nhumrich commentedon Oct 6, 2020
Autoreflection/Engine are orm properties. As the readme states, this repo currently doesn't support orm properties, only query builder (SQLAlchemy Core). I am not opposed to having this library support it, it is just out of the scope for myself, as I do not use the ORM/Engine side of sqlalchemy. Would be interested in reviewing a PR that attempts to add this to the library however.
temoto commentedon Oct 6, 2020
You may know better, but sqlalchemy docs say it's core. https://docs.sqlalchemy.org/en/13/core/reflection.html
temoto commentedon Oct 6, 2020
Engine is also in core. https://docs.sqlalchemy.org/en/13/core/engines_connections.html
nhumrich commentedon Oct 6, 2020
Ok, yes, you are right, this is part of the "core" functionality section. And the fact that it just loads a table does make it core. Either way, today, the "engine" abstraction has yet to be implemented. Would be open to someone doing it.
temoto commentedon Oct 6, 2020
I will do it but need a bit guidance. Do you know what exactly needs to be implemented: Engine or Connectable wrapper for SAConnection or CreateEnginePlugin or something else?
nhumrich commentedon Oct 8, 2020
I honestly haven't looked into it too much, but I think if the Engine is implemented, that might be enough.
temoto commentedon Oct 8, 2020
They have already implemented it https://github.com/sqlalchemy/sqlalchemy/blob/c3f102c9fe9811fd5286628cc6aafa5fbc324621/lib/sqlalchemy/ext/asyncio/engine.py
It seems sqlalchemy 1.4+ can be run without asyncpgsa altogether, but there is no shortage of issues reported and my task is overdue, so using psycopg2 for reflection so far. I'll post updates here.