Похожие чаты

Have someone used `postgresql+psycopg` (psycopg aka. psycopg3) as "`dialect+driver`" for

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?

7 ответов

33 просмотра

what is your sqlalchemy version?

Have you tried just write postgresql://?

Tishka17
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.

Tishka17
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.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта