llama-index readers snowflake integration
Project description
Snowflake Loader
pip install llama-index-readers-snowflake
This loader connects to Snowflake (using SQLAlchemy under the hood). The user specifies a query and extracts Document objects corresponding to the results. You can use this loader to easily connect to a database on Snowflake and pass the documents into a GPTSQLStructStoreIndex
from LlamaIndex.
Usage
Option 1: Pass your own SQLAlchemy Engine object of the database connection
Here's an example usage of the SnowflakeReader.
from llama_index.readers.snowflake import SnowflakeReader
reader = SnowflakeReader(
engine=your_sqlalchemy_engine,
)
query = "SELECT * FROM your_table"
documents = reader.load_data(query=query)
Option 2: Pass the required parameters to esstablish Snowflake connection
Here's an example usage of the SnowflakeReader.
from llama_index.readers.snowflake import SnowflakeReader
reader = SnowflakeReader(
account="your_account",
user="your_user",
password="your_password",
database="your_database",
schema="your_schema",
warehouse="your_warehouse",
role="your_role", # Optional role setting
proxy="http://proxusername:proxypassword@myproxy:port", # Optional proxy setting
)
query = "SELECT * FROM your_table"
documents = reader.load_data(query=query)
Author
This loader is designed to be used as a way to load data into LlamaIndex.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_readers_snowflake-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_snowflake-0.2.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e455b2e8273de125bc4482d12761f61c51b0d5f20a3e2c9f64b3fb8be2108c1b |
|
MD5 | 3ca04a28a65a6b86d83525d4b3d8aedf |
|
BLAKE2b-256 | 4b0b7aa270395b261c89e83beed66bf04eee6b46937e9b3fcfd34b2569bc7da2 |
File details
Details for the file llama_index_readers_snowflake-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_snowflake-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5923eb3a2d6090132b5eb55bc735eab78fbfdccb564784b6f83fe0b60c284187 |
|
MD5 | bc6441abf5057a15b7ddff79c1c5e93c |
|
BLAKE2b-256 | 8cc2c4ddaf71451ed8e75415176431dc479ef6433200215b03dd80a1d394c584 |