SnowflakeQueryTool(
self,
**kwargs = {},
)Execute SQL queries on Snowflake.
This tool allows execution of SQL queries against a Snowflake database and returns the results in a formatted manner.
Setup:
Install langchain-snowflake and configure Snowflake connection.
.. code-block:: bash
pip install -U langchain-snowflake
Instantiation:
.. code-block:: python
from . import SnowflakeQueryTool
tool = SnowflakeQueryTool( session=session, # or connection parameters account="your-account", user="your-user", password="your-password", warehouse="your-warehouse" )
Invocation:
.. code-block:: python
result = tool.invoke({"query": "SELECT COUNT(*) FROM my_table"}) print(result)