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:
Mohammad Mohtashim authored and GitHub committed 2024-01-17 10:31:11 -08:00
1 parent 11327e6b64
commit 1fa056c324
1 file changed
+2 -1
@@ -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":