Похожие чаты

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

31 просмотр

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.

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

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

Hey everyone! I won’t focus too much on what this person said (it’s clear they don’t understand the scope of what TF and TELOSX are achieving), but I’ll put it simply for thos...
Ana Ojeda
3
как правильно удалить сддм? прописал в etc/portage.use/plasma-meta -sddm , но при обновлении юзов мне предлагает поставить lightdm (ещё лучше 😡), добавил туда - display-manage...
REDis
25
Telos is at a pivotal moment. While ambitious projects like zkEVM and SNARKtor have shown promise, the delay in delivering EVM 2.0—a cornerstone of the ecosystem—is a growing ...
Trinidad
8
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
#include <stdio.h> #include <stdlib.h> #include <time.h> void mass_first_generate(int mass[5][7]) {     for (int N = 0; N < 5; N++) {         for (int A = 0; A < 7; A++) {   ...
Чувак
6
Всем привет! Решаю 99 OCaml Problems и столкнулся со следующей проблемой (прошу палками не забивать, я OCaml практически не трогал до этого момента): open OUnit2 let create_...
К|/|pи/\/\ 6е3yглbIи
2
Except the wealthiest, people that buy crypto want to "cash out" at the end of the day, one way or another. Converting to fiat is craziness, converting to BTC is unwise. Hold ...
Erdelanax
2
Hello guys, hope you can help me with a quick question. I've staked some ZIL using Atomic Wallet some while ago and wanted to claim my rewards and unstake it. Atomic Wallet sa...
Martin | #bornbrave
14
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
https://www.linkedin.com/posts/ugama-benedicta-kelechi-codergirl-103041300_mobiledevelopment-fluttertraining-handsonlearning-activity-7263445699227254784-IdHB?utm_source=share...
CoderGirl
16
Карта сайта