fix: Upgrading psycopg (#3869)

This commit is contained in:
shaohuzhang1 2025-08-18 10:39:21 +08:00 committed by GitHub
parent 8031b0a2fa
commit 3d6bcb99d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -1,9 +1,8 @@
# Generated by Django 4.2.15 on 2024-09-18 16:14
import logging
import psycopg2
import psycopg
from django.db import migrations
from psycopg2 import extensions
from smartdoc.const import CONFIG
@ -17,7 +16,7 @@ def get_connect(db_name):
"port": CONFIG.get('DB_PORT')
}
# 建立连接
connect = psycopg2.connect(**conn_params)
connect = psycopg.connect(**conn_params)
return connect
@ -28,7 +27,7 @@ def sql_execute(conn, reindex_sql: str, alter_database_sql: str):
@param conn:
@param alter_database_sql:
"""
conn.set_isolation_level(extensions.ISOLATION_LEVEL_AUTOCOMMIT)
conn.autocommit = True
with conn.cursor() as cursor:
cursor.execute(reindex_sql, [])
cursor.execute(alter_database_sql, [])

View File

@ -23,7 +23,7 @@ langchain-huggingface = "0.1.2"
langchain-ollama = "0.3.2"
langgraph = "0.3.27"
mcp = "1.8.0"
psycopg2-binary = "2.9.10"
psycopg = { extras = ["binary"], version = "3.2.9" }
jieba = "0.42.1"
diskcache = "5.6.3"
pillow = "10.4.0"