# 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:
```bash
pip install llama-index-readers-database
```
## Usage
```python
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](https://github.com/run-llama/llama_index/tree/main/llama_index).
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-database",
"maintainer": "kevinqz",
"docs_url": null,
"requires_python": "<4.0,>=3.8.1",
"maintainer_email": null,
"keywords": "aws rds, postgres, snowflake, sql",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/29/82/323adbf63995e0cc2600382dea9cd3918c3b192f612cfd7e96d7b12f13c0/llama_index_readers_database-0.1.4.tar.gz",
"platform": null,
"description": "# LlamaIndex Readers Integration: Database\n\n## Overview\n\nDatabase Reader is a tool designed to query and load data from databases efficiently.\n\n### Installation\n\nYou can install Database Reader via pip:\n\n```bash\npip install llama-index-readers-database\n```\n\n## Usage\n\n```python\nfrom llama_index.core.schema import Document\nfrom llama_index.readers.database import DatabaseReader\n\n# Initialize DatabaseReader with the SQL database connection details\nreader = DatabaseReader(\n sql_database=\"<SQLDatabase Object>\", # Optional: SQLDatabase object\n engine=\"<SQLAlchemy Engine Object>\", # Optional: SQLAlchemy Engine object\n uri=\"<Connection URI>\", # Optional: Connection URI\n scheme=\"<Scheme>\", # Optional: Scheme\n host=\"<Host>\", # Optional: Host\n port=\"<Port>\", # Optional: Port\n user=\"<Username>\", # Optional: Username\n password=\"<Password>\", # Optional: Password\n dbname=\"<Database Name>\", # Optional: Database Name\n)\n\n# Load data from the database using a query\ndocuments = reader.load_data(\n query=\"<SQL Query>\" # SQL query parameter to filter tables and rows\n)\n```\n\nThis loader is designed to be used as a way to load data into\n[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers database integration",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [
"aws rds",
" postgres",
" snowflake",
" sql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6a0e084a7ca56ad23209387c24608702a3c27d18fed3e9ec15f8e932751f658f",
"md5": "417a5d89a54dafb6c60348faef0f3e9e",
"sha256": "73cbaa5b627c90c01693a187180535c495205bdc6ba258804b00631409a79e74"
},
"downloads": -1,
"filename": "llama_index_readers_database-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "417a5d89a54dafb6c60348faef0f3e9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 3178,
"upload_time": "2024-05-02T17:08:22",
"upload_time_iso_8601": "2024-05-02T17:08:22.228478Z",
"url": "https://files.pythonhosted.org/packages/6a/0e/084a7ca56ad23209387c24608702a3c27d18fed3e9ec15f8e932751f658f/llama_index_readers_database-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2982323adbf63995e0cc2600382dea9cd3918c3b192f612cfd7e96d7b12f13c0",
"md5": "47ca1738e6f670170067e574bf0fa221",
"sha256": "c7bd7eb330cd0d935a55cf00317aee2afc52357839eb589b136fa4c79df31df2"
},
"downloads": -1,
"filename": "llama_index_readers_database-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "47ca1738e6f670170067e574bf0fa221",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8.1",
"size": 2835,
"upload_time": "2024-05-02T17:08:23",
"upload_time_iso_8601": "2024-05-02T17:08:23.691128Z",
"url": "https://files.pythonhosted.org/packages/29/82/323adbf63995e0cc2600382dea9cd3918c3b192f612cfd7e96d7b12f13c0/llama_index_readers_database-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-02 17:08:23",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-database"
}