include_tables not including tables in non dbo object #10328
-
I am connecting to SQLServer. i tried following none of the combination working. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
🤖 Hello, To include non-dbo schema tables when creating a db object from SQLDatabase in LangChain, you need to specify the schema name when initializing the SQLDatabase object. The Here is an example of how you can do this: from sqlalchemy import create_engine
from langchain.utilities.sql_database import SQLDatabase
engine = create_engine('your_database_uri')
db = SQLDatabase(engine, schema='your_schema_name') In this example, replace The SQLDatabase class in LangChain does support the inclusion of tables from non-dbo schemas. This is evident from the Moreover, in the I hope this helps! If you have any other questions, feel free to ask. Best, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
🤖
Hello,
To include non-dbo schema tables when creating a db object from SQLDatabase in LangChain, you need to specify the schema name when initializing the SQLDatabase object. The
schema
parameter in the__init__
method of the SQLDatabase class is used to specify the schema of the tables you want to include.Here is an example of how you can do this:
In this example, replace
'your_database_uri'
with the URI of your database and'your_schema_name'
with the name of the schema you want to include.The S…