Похожие чаты

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 ответов

19 просмотров

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.

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

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

А кто-то пробовал, уезжая из Эстонии получить э-рез и продолжить вести предпринимательскую деятельность внутри Эстонии, используя свой OÜ?
Lalalashechki Lalala
62
@MrMiscipitlick А можешь макрос написать, который будет вычислять смещение относительно переданных меток? Просто .label1-.label2, и вернуть значение.
КТ315
35
Чем оно проблема?
Nikita Uzumaki
21
Hi, I was reading this https://twitter.com/HouseofChimera/status/1778078991762780408 about Verasity and their likely choice of Tron as blockchain for their token for its low f...
Jordi
13
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
@samkazemian - couple questions: Update on frxBTC? - This would do well with the current influx of institutional investment entering the space Update on future veFXS streams...
Costi
16
А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Подобного рода ;Следующие три строки это директивы ассемблера, ;которые можно не задавать, т.к.работаем в Visual Studio. ;Символ ";" - это начало однострочного комментария ...
Егор Анелькин
3
Does anyone here have a connection Mullvad? it would be nice to know what it would take to have them accept BCH 0-conf.
tl121x
16
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
5
Карта сайта