Replies: 1 comment
-
@thematica If you put: lazy_table_reflection=True as an argument to SQLDatabase.from_uri() it skips loading metadata about your database. It initializes in a few seconds now instead of over a minute for me. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
i'm trying to learn how to code AI using python (never use this language before)
the code will try to connect to our production database which is very large (1.xTB data, hundreds of tables)
while the connection is created, but the code seems waiting something (didn't show the prompt)
i did check on the MSSQL side, it seems the session is scanning or reading something from the server?
i literally wait for 15 minutes before i give up and cancel the code (the connection on the server also closed)
i tried creating simple database LOGS with only 1 tables and 30 rows, it connect just fine
same code but with different database (this one is successfully connect and show the prompt)
db = SQLDatabase.from_uri("mssql+pyodbc://readonly:password1@SQLSERVER/LOGS?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes")
anyone can help me on this?
Thank you very much
PS: i also tried simple connection from python to MSSQL using pyodbc
and it successfully connect and run the static query i put in the command (not AI related, just simple code to test connect python to MSSQL). so i don't think pyodbc or my SQL Server is the problem.
System Info
Windows 11
Python 3.12
Beta Was this translation helpful? Give feedback.
All reactions