|
1 | 1 | import secrets |
| 2 | +import urllib.parse |
2 | 3 | from typing import Annotated, Any, Literal |
3 | 4 |
|
4 | 5 | from pydantic import ( |
@@ -76,14 +77,15 @@ def all_cors_origins(self) -> list[str]: |
76 | 77 | def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn | str: |
77 | 78 | if self.SQLBOT_DB_URL: |
78 | 79 | return self.SQLBOT_DB_URL |
79 | | - return MultiHostUrl.build( |
80 | | - scheme="postgresql+psycopg", |
81 | | - username=self.POSTGRES_USER, |
82 | | - password=self.POSTGRES_PASSWORD, |
83 | | - host=self.POSTGRES_SERVER, |
84 | | - port=self.POSTGRES_PORT, |
85 | | - path=self.POSTGRES_DB, |
86 | | - ) |
| 80 | + # return MultiHostUrl.build( |
| 81 | + # scheme="postgresql+psycopg", |
| 82 | + # username=urllib.parse.quote(self.POSTGRES_USER), |
| 83 | + # password=urllib.parse.quote(self.POSTGRES_PASSWORD), |
| 84 | + # host=self.POSTGRES_SERVER, |
| 85 | + # port=self.POSTGRES_PORT, |
| 86 | + # path=self.POSTGRES_DB, |
| 87 | + # ) |
| 88 | + return f"postgresql+psycopg://{urllib.parse.quote(self.POSTGRES_USER)}:{urllib.parse.quote(self.POSTGRES_PASSWORD)}@{self.POSTGRES_SERVER}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}" |
87 | 89 |
|
88 | 90 | MCP_IMAGE_PATH: str = '/opt/sqlbot/images' |
89 | 91 | EXCEL_PATH: str = '/opt/sqlbot/data/excel' |
|
0 commit comments