llama-index readers snowflake integration
Project description
Snowflake Loader
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 import download_loader
SnowflakeReader = download_loader("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 import download_loader
SnowflakeReader = download_loader("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 and/or subsequently used as a Tool in a LangChain Agent. See here for examples.
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
Close
Hashes for llama_index_readers_snowflake-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc3a491034ab55adccd78ee920df2741678f1d7dfbfd784f88462d85325f535e |
|
MD5 | fa847dc48c362f28cfd83fef31fcceef |
|
BLAKE2b-256 | 2d44623f83e38fee89e93b04cad9df4d3883694e3c565a705ce253d6a5547eac |
Close
Hashes for llama_index_readers_snowflake-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12cb73b17acc8704265b098c76b4662d6b1fa2330a7c7e923ee680ccdcaf8b83 |
|
MD5 | 6ced7d108328b756830c01e5440f4fb0 |
|
BLAKE2b-256 | 72849aa79665a0c13a74f1f404a2125537a98e9966fad1aaa48d26a38175030c |