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.3.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_snowflake-0.3.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e976c7d9b3bff6c8cc68505e3563afc63180cf602fa27e47e5abacd767ad369 |
|
MD5 | 5b594fa1a9d5e5d7ec94c092fcf66b23 |
|
BLAKE2b-256 | 71913e1953afdcf33f8efe218bddd20bdfc1f0477b2001599ab86f3e8d056c83 |
File details
Details for the file llama_index_readers_snowflake-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_snowflake-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25f54215ea7266a5eaa68e54f0f7a1b0b619b5cbf98e0b060581457038b1d296 |
|
MD5 | 4e772cc2edf543ade4a7c0ad23f14bed |
|
BLAKE2b-256 | bdd5fe991e2c8d7dd0f66ed949edc13b3a2717c6cecad71b26ebbc6b698f0d5f |