# st.connections.SnowflakeConnection

Source: https://docs.streamlit.io/develop/api-reference/connections/st.connections.snowflakeconnection

> **Tip**
>
> This page only contains the `st.connections.SnowflakeConnection` class. For a deeper dive into creating and managing data connections within Streamlit apps, see [Connect Streamlit to Snowflake](https://docs.streamlit.io/develop/tutorials/databases/snowflake) and [Connecting to data](https://docs.streamlit.io/develop/concepts/connections/connecting-to-data).

* Function signature:

   ```python
   st.connections.SnowflakeConnection(connection_name, **kwargs)
   ```

* Function signature:

   ```python
   SnowflakeConnection.cursor()
   ```

* Returns: snowflake.connector.cursor.SnowflakeCursor

    A cursor object for the connection.

* Function signature:

   ```python
   SnowflakeConnection.query(sql, *, ttl=None, show_spinner="Running `snowflake.query(...)`.", params=None, **kwargs)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | sql | str |  | The read-only SQL query to execute. |
   | ttl | float, int, timedelta or None |  | The maximum number of seconds to keep results in the cache. If this is None (default), cached results do not expire with time. |
   | show_spinner | boolean or string | to | Whether to enable the spinner. When a cached query is executed, no spinner is displayed because the result is immediately available. When a new query is executed, the default is to show a spinner with the message "Running snowflake.query(...)." If this is False, no spinner displays while executing the query. If this is a string, the string will be used as the message for the spinner. |
   | params | list, tuple, dict or None |  | List of parameters to pass to the Snowflake Connector for Python Cursor.execute() method. This connector supports binding data to a SQL statement using qmark bindings. For more information and examples, see the Snowflake Connector for Python documentation. This defaults to None. |

* Returns: pandas.DataFrame

    The result of running the query, formatted as a pandas DataFrame.

* Function signature:

   ```python
   SnowflakeConnection.raw_connection
   ```

* Returns: snowflake.connector.connection.SnowflakeConnection

    The connection object.

* Function signature:

   ```python
   SnowflakeConnection.reset()
   ```

* Function signature:

   ```python
   SnowflakeConnection.session()
   ```

* Returns: snowflake.snowpark.Session

    A new Snowpark session for this connection.

* Function signature:

   ```python
   SnowflakeConnection.write_pandas(df, table_name, database=None, schema=None, chunk_size=None, **kwargs)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | df | pandas.DataFrame |  | The pandas.DataFrame object containing the data to be copied into the table. |
   | table_name | str |  | Name of the table where the data should be copied to. |
   | database | str |  | Name of the database containing the table. By default, the function writes to the database that is currently in use in the session.  Note If you specify this parameter, you must also specify the schema parameter. |
   | schema | str |  | Name of the schema containing the table. By default, the function writes to the table in the schema that is currently in use in the session. |
   | chunk_size | int |  | Number of elements to insert at a time. By default, the function inserts all elements in one chunk. |
   | **kwargs | Any |  | Additional keyword arguments for snowflake.connector.pandas_tools.write_pandas(). |

* Returns: tuple[bool, int, int]

    A tuple containing three values:

A boolean value that is True if the write was successful.
An integer giving the number of chunks of data that were copied.
An integer giving the number of rows that were inserted.
