Skip to main content

llama-index readers database integration

Project description

LlamaIndex Readers Integration: Database

Overview

Database Reader is a tool designed to query and load data from databases efficiently.

Installation

You can install Database Reader via pip:

pip install llama-index-readers-database

Usage

from llama_index.core.schema import Document
from llama_index.readers.database import DatabaseReader

# Initialize DatabaseReader with the SQL database connection details
reader = DatabaseReader(
    sql_database="<SQLDatabase Object>",  # Optional: SQLDatabase object
    engine="<SQLAlchemy Engine Object>",  # Optional: SQLAlchemy Engine object
    uri="<Connection URI>",  # Optional: Connection URI
    scheme="<Scheme>",  # Optional: Scheme
    host="<Host>",  # Optional: Host
    port="<Port>",  # Optional: Port
    user="<Username>",  # Optional: Username
    password="<Password>",  # Optional: Password
    dbname="<Database Name>",  # Optional: Database Name
)

# Load data from the database using a query
documents = reader.load_data(
    query="<SQL Query>"  # SQL query parameter to filter tables and rows
)

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

llama_index_readers_database-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_database-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_database-0.3.0.tar.gz
Algorithm Hash digest
SHA256 00be4aa0304a2af37aae55f2bc8118d438748fa0f214b812696124de787a9116
MD5 ca0e18b7a13c119b4af93218506d20d0
BLAKE2b-256 2138d69725c9bc7b6c35390315ac239eb72dbe6faf107f2e4b960458b22e647d

See more details on using hashes here.

File details

Details for the file llama_index_readers_database-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_database-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff532ee1a3c3162656ab517fd5b715a4c74cb3aab33ea921aea1be0ec55b391
MD5 f8e2805591e7abaa764d0a617eff7f18
BLAKE2b-256 f4d1ebedf65795390ccad2d806981f444bb27081c7de3ba5c0a89f2276aef2bd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page