mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 15:43:54 +00:00
community[patch]: Don't set search path for unknown SQL dialects (#16047)
- **Description:** Made a small fix for the `SQLDatabase` highlighted in an issue. The issue pertains to switching schema for different SQL engines. - **Issue:** #16023 @baskaryan
This commit is contained in:
parent
11327e6b64
commit
1fa056c324
@ -409,8 +409,9 @@ class SQLDatabase:
|
||||
# If anybody using Sybase SQL anywhere database then it should not
|
||||
# go to else condition. It should be same as mssql.
|
||||
pass
|
||||
else: # postgresql and other compatible dialects
|
||||
elif self.dialect == "postgresql": # postgresql
|
||||
connection.exec_driver_sql("SET search_path TO %s", (self._schema,))
|
||||
|
||||
cursor = connection.execute(text(command))
|
||||
if cursor.returns_rows:
|
||||
if fetch == "all":
|
||||
|
Loading…
Reference in New Issue
Block a user