# create_session_from_connection_string

> **Function** in `langchain_snowflake`

📖 [View in docs](https://reference.langchain.com/python/langchain-snowflake/create_session_from_connection_string)

Create a Snowflake session from a connection string in environment variables.

Reads connection string from SNOWFLAKE_CONNECTION_STRING environment variable.
Supports environment variable substitution using ${VARIABLE_NAME} syntax.

Required environment variable:
- SNOWFLAKE_CONNECTION_STRING: Connection string with format
  snowflake://user:password@account/database/schema?warehouse=warehouse_name

Example connection string with environment variable substitution:
SNOWFLAKE_CONNECTION_STRING="snowflake://${SNOWFLAKE_USER}:${SNOWFLAKE_PASSWORD}@${SNOWFLAKE_ACCOUNT}/${SNOWFLAKE_DATABASE}/${SNOWFLAKE_SCHEMA}?warehouse=${SNOWFLAKE_WAREHOUSE}"

## Signature

```python
create_session_from_connection_string() -> Session
```

## Returns

`Session`

Configured Snowflake session

---

[View source on GitHub](https://github.com/langchain-ai/langchain-snowflake/blob/1a32a1c6642b6c453e9537f35afbc7da280f8679/libs/snowflake/langchain_snowflake/__init__.py#L94)