Skip to content

Commit

Permalink
community[patch]: support for Sybase SQL anywhere added. (#14821)
Browse files Browse the repository at this point in the history
- **Description:** support for Sybase SQL anywhere added in
sql_database.py file at path
langchain\libs\community\langchain_community\utilities
- **Issue:** It will resolve default schema setting for Sybase SQL
anywhere
  - **Dependencies:** No,
  - **Tag maintainer:** @baskaryan, @eyurtsev, @hwchase17,
  - **Twitter handle:** NA

---------

Co-authored-by: learn360sujeet <[email protected]>
Co-authored-by: Bagatur <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2023
1 parent 1acc7ff commit f1d3f29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/community/langchain_community/utilities/sql_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ def _execute(
connection.exec_driver_sql(
f"ALTER SESSION SET CURRENT_SCHEMA = {self._schema}"
)
elif self.dialect == "sqlany":
# 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
connection.exec_driver_sql("SET search_path TO %s", (self._schema,))
cursor = connection.execute(text(command))
Expand Down

0 comments on commit f1d3f29

Please sign in to comment.