Skip to content
Discussion options

You must be logged in to vote

🤖

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:

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 '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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nishantpandey107
Comment options

Answer selected by nishantpandey107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant