Agno's SQLTools now always uses the db_engine you pass, even when you also give connection fields. Before, passing user, password, host, port and dialect replaced the engine, so the agent queried whatever database those fields pointed at, with no warning. This call now keeps engine:
SQLTools(db_engine=engine, user="agent", password="secret", host="db.internal", port=5432, dialect="postgresql+psycopg")We built that call on both releases with a SQLite engine and printed the URL SQLTools kept:
Before: engine in use: postgresql+psycopg://agent:***@db.internal:5432
Now: engine in use: sqlite:////.../shop.dbrun_sql_query also hid errors raised while reading rows. A SQLite query whose second row overflows in abs() fails during the fetch, and earlier releases answered with an empty list:
Before: run_sql_query: []
Now: run_sql_query: Error running query: (sqlite3.OperationalError) integer overflowThe agent now sees the real database error and can fix the query or tell the user.
See the cookbook, and learn more about SQLTools in the documentation.
Frequently asked questions
The db_engine. It already took priority over db_url, and it now also takes priority over user, password, host, port and dialect. Without a db_engine, SQLTools builds one from db_url when you give it, and otherwise from the connection fields.
With a SQLite engine plus Postgres connection fields for a host that does not resolve, earlier releases printed engine in use: postgresql+psycopg://agent:***@db.internal:5432 and list_tables failed with failed to resolve host 'db.internal'. This release keeps the SQLite engine and list_tables returns ["orders"].
run_sql wrapped the row fetch in a handler that logged the error and returned an empty list, so the agent could not tell a failed read from a query with no matches. The handler is gone, and run_sql_query turns the exception into its usual Error running query: ... string.





