# Snowflake Query Engine Pack
This LlamaPack uses `snowflake-sqlalchemy` to connect to Snowflake, then calls `NLSQLTableQueryEngine` to query data.
## Usage
You can download the pack to a the `./snowflake_pack` directory:
```python
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
SnowflakeQueryEnginePack = download_llama_pack(
"SnowflakeQueryEnginePack", "./snowflake_pack"
)
```
From here, you can use the pack, or inspect and modify the pack in `./snowflake_pack`.
`NLSQLTableQueryEngine` uses OpenAI models by default, ensure you set your OpenAI API key.
You can set up the pack by passing in the Snowflake connection details and the table(s):
```python
# create the pack
snowflake_pack = SnowflakeQueryEnginePack(
user="<USER>",
password="<PASSWORD>",
account="<ORG>-<ACCOUNT>",
database="<DATABASE>",
schema="<SCHEMA>",
warehouse="<WAREHOUSE>",
role="<ROLE>",
tables=["<TABLE1>", "<TABLE2>", ...],
)
```
The `run()` function is a light wrapper around `query_engine.query()`. See below a sample query run. You can add additional prompt in the query text.
```python
response = snowflake_pack.run(
"Give me the repo id with the most stars on 2023-12-01."
)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-packs-snowflake-query-engine",
"maintainer": "wenqiglantz",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "engine, query, snowflake",
"author": null,
"author_email": "Your Name <you@example.com>",
"download_url": "https://files.pythonhosted.org/packages/ef/9c/1f8c899cae755e772b1f2b41e56a185add70d7c5a4ae71b9f10f868f1592/llama_index_packs_snowflake_query_engine-0.5.1.tar.gz",
"platform": null,
"description": "# Snowflake Query Engine Pack\n\nThis LlamaPack uses `snowflake-sqlalchemy` to connect to Snowflake, then calls `NLSQLTableQueryEngine` to query data.\n\n## Usage\n\nYou can download the pack to a the `./snowflake_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nSnowflakeQueryEnginePack = download_llama_pack(\n \"SnowflakeQueryEnginePack\", \"./snowflake_pack\"\n)\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./snowflake_pack`.\n\n`NLSQLTableQueryEngine` uses OpenAI models by default, ensure you set your OpenAI API key.\n\nYou can set up the pack by passing in the Snowflake connection details and the table(s):\n\n```python\n# create the pack\nsnowflake_pack = SnowflakeQueryEnginePack(\n user=\"<USER>\",\n password=\"<PASSWORD>\",\n account=\"<ORG>-<ACCOUNT>\",\n database=\"<DATABASE>\",\n schema=\"<SCHEMA>\",\n warehouse=\"<WAREHOUSE>\",\n role=\"<ROLE>\",\n tables=[\"<TABLE1>\", \"<TABLE2>\", ...],\n)\n```\n\nThe `run()` function is a light wrapper around `query_engine.query()`. See below a sample query run. You can add additional prompt in the query text.\n\n```python\nresponse = snowflake_pack.run(\n \"Give me the repo id with the most stars on 2023-12-01.\"\n)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "llama-index packs snowflake_query_engine integration",
"version": "0.5.1",
"project_urls": null,
"split_keywords": [
"engine",
" query",
" snowflake"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9a0758452378f6e1fa862913075e01e3065ff8fddee520e590d32469b6c56244",
"md5": "8e12c41f17145031d3a2a07515877f29",
"sha256": "2e7530b988550e5db06d1b5034cff5ad1d35aab442868f3103b85325d8b78b45"
},
"downloads": -1,
"filename": "llama_index_packs_snowflake_query_engine-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e12c41f17145031d3a2a07515877f29",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 4209,
"upload_time": "2025-09-08T20:49:08",
"upload_time_iso_8601": "2025-09-08T20:49:08.479847Z",
"url": "https://files.pythonhosted.org/packages/9a/07/58452378f6e1fa862913075e01e3065ff8fddee520e590d32469b6c56244/llama_index_packs_snowflake_query_engine-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ef9c1f8c899cae755e772b1f2b41e56a185add70d7c5a4ae71b9f10f868f1592",
"md5": "088d9e77742ca1119c52d5e348586ba6",
"sha256": "27d2b5dac7a9030e3c2ddbb577abb4a8b9eef611efedfc08fe3a54bdd8fbc5cf"
},
"downloads": -1,
"filename": "llama_index_packs_snowflake_query_engine-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "088d9e77742ca1119c52d5e348586ba6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 4380,
"upload_time": "2025-09-08T20:49:09",
"upload_time_iso_8601": "2025-09-08T20:49:09.191737Z",
"url": "https://files.pythonhosted.org/packages/ef/9c/1f8c899cae755e772b1f2b41e56a185add70d7c5a4ae71b9f10f868f1592/llama_index_packs_snowflake_query_engine-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 20:49:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-snowflake-query-engine"
}