sqlachemy, and also with alembic?
Context:
`engine = create_engine(
"postgresql+psycopg://sheenaz:10052008taras@localhost:5432/foo-sqlachemy",
pool_recycle=3600,
echo=True,
)`
I'm asking 'cause i get error from sqlachemy when trying to create autogenerated revision by alembic:
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:driver
I know that I can simply use psycopg2, but at official documentation is claimed support for psycopg3, but in my case sqlalchemy doesn't recognize psyopcg3` as eligble driver.
So have someone used psycopg3 with sqlachemy and alembic and have you encountered the same problem, if yes, then how to fix that?
what is your sqlalchemy version?
Have you tried just write postgresql://?
yes, this works fine but it's uses psycopg2 as driver by default (if you don't specify driver for postgresql dialect) , but i'd like to use psycopg3.
what if uninstall psycopg2?
I have tried to conect to postgres only with sqlalchemy (without alembic) to do some DD (Data Definiton -> creating tables) and DM (Data Manipulation -> CRUD)operations, like Base.metadata.create_all(bind=POSTGRES_ENGINE) by using postgresql+psycopg in engine url, and all works fine, as i understand this is problem of alembic, not the sqlachemy.
Обсуждают сегодня