You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team and I read the documentation and proceded to build the following block of code following the Custom Table Info SQL Langchain section of the LangChain docs. However, it only keeps detecting only one table (table1) from our database instead of both specified by the include_tables parameter.
What is wrong with our code? Is there any way to select multiple tables using the custom_table_info dictionary? (Ignore the DDL SQL structure as we edited the code for privacy reasons).
custom_table_info= {
"table1": """CREATE TABLE table1 ( "id" SERIAL NOT NULL, "name" VARCHAR(50) NOT NULL, CONSTRAINT fkey FOREIGN KEY(id) REFERENCES table2 (id) ON DELETE SET NULL )*/""",
"table2": """CREATE TABLE table2 ( "id" integer NOT NULL DEFAULT nextval('id_seq'::regclass), "name" character varying COLLATE pg_catalog."default" NOT NULL, CONSTRAINT table2_pkey PRIMARY KEY (id) )*/"""
}
db=SQLDatabase.from_uri(f"postgresql+psycopg2://our_uri", include_tables=['table1','table2'],custom_table_info=custom_table_info)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My team and I read the documentation and proceded to build the following block of code following the Custom Table Info SQL Langchain section of the LangChain docs. However, it only keeps detecting only one table (table1) from our database instead of both specified by the
include_tables
parameter.What is wrong with our code? Is there any way to select multiple tables using the
custom_table_info
dictionary? (Ignore the DDL SQL structure as we edited the code for privacy reasons).Beta Was this translation helpful? Give feedback.
All reactions