We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1432db commit eef2b5eCopy full SHA for eef2b5e
vector_db/mssql_provider.py
@@ -134,9 +134,14 @@ def _ensure_database_exists(self) -> None:
134
f"IF DB_ID('{database}') IS NULL CREATE DATABASE [{database}]"
135
)
136
cursor.close()
137
- except Exception as e:
+ except pyodbc.ProgrammingError as e:
138
+ if "1801" in str(e):
139
+ logger.info("Database %s already exists, continuing", database)
140
+ return
141
logger.exception("Failed to ensure database '%s' exists", database)
- raise RuntimeError(f"Failed to ensure database '{database}' exists: {e}")
142
+ raise RuntimeError(
143
+ f"Failed to ensure database '{database}' exists: {e}"
144
+ ) from e
145
146
def add_documents(self, docs: List[Document]) -> None:
147
"""
0 commit comments