mirror of https://github.com/hwchase17/langchain
fix sqlite internal tables breaking table_info (#1224)
With the current method used to get the SQL table info, sqlite internal schema tables are being included and are not being handled correctly by sqlalchemy because the columns have no types. This is easy to see with the Chinook database: ```python db = SQLDatabase.from_uri("sqlite:///Chinook.db") print(db.table_info) ``` ```python ... sqlalchemy.exc.CompileError: (in table 'sqlite_sequence', column 'name'): Can't generate DDL for NullType(); did you forget to specify a type on this Column? ``` SQLAlchemy 2.0 [ignores these by default](pull/1237/head63d90b0f44/lib/sqlalchemy/dialects/sqlite/base.py (L856-L880)
):63d90b0f44/lib/sqlalchemy/dialects/sqlite/base.py (L2096-L2123)
parent
4e28982d2b
commit
ac1320aae8
Loading…
Reference in New Issue