mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
cd52433ba0
- **Description:** A generic document loader adapter for SQLAlchemy on top of LangChain's `SQLDatabaseLoader`. - **Needed by:** https://github.com/crate-workbench/langchain/pull/1 - **Depends on:** GH-16655 - **Addressed to:** @baskaryan, @cbornet, @eyurtsev Hi from CrateDB again, in the same spirit like GH-16243 and GH-16244, this patch breaks out another commit from https://github.com/crate-workbench/langchain/pull/1, in order to reduce the size of this patch before submitting it, and to separate concerns. To accompany the SQLAlchemy adapter implementation, the patch includes integration tests for both SQLite and PostgreSQL. Let me know if corresponding utility resources should be added at different spots. With kind regards, Andreas. ### Software Tests ```console docker compose --file libs/community/tests/integration_tests/document_loaders/docker-compose/postgresql.yml up ``` ```console cd libs/community pip install psycopg2-binary pytest -vvv tests/integration_tests -k sqldatabase ``` ``` 14 passed ``` ![image](https://github.com/langchain-ai/langchain/assets/453543/42be233c-eb37-4c76-a830-474276e01436) --------- Co-authored-by: Andreas Motl <andreas.motl@crate.io>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
# docker-compose to make it easier to spin up integration tests.
|
|
# Services should use NON standard ports to avoid collision with
|
|
# any existing services that might be used for development.
|
|
# ATTENTION: When adding a service below use a non-standard port
|
|
# increment by one from the preceding port.
|
|
# For credentials always use `langchain` and `langchain` for the
|
|
# username and password.
|
|
version: "3"
|
|
name: langchain-tests
|
|
|
|
services:
|
|
redis:
|
|
image: redis/redis-stack-server:latest
|
|
# We use non standard ports since
|
|
# these instances are used for testing
|
|
# and users may already have existing
|
|
# redis instances set up locally
|
|
# for other projects
|
|
ports:
|
|
- "6020:6379"
|
|
volumes:
|
|
- ./redis-volume:/data
|
|
graphdb:
|
|
image: graphdb
|
|
ports:
|
|
- "6021:7200"
|
|
mongo:
|
|
image: mongo:latest
|
|
container_name: mongo_container
|
|
ports:
|
|
- "6022:27017"
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: langchain
|
|
MONGO_INITDB_ROOT_PASSWORD: langchain
|
|
postgres:
|
|
image: postgres:16
|
|
environment:
|
|
POSTGRES_DB: langchain
|
|
POSTGRES_USER: langchain
|
|
POSTGRES_PASSWORD: langchain
|
|
ports:
|
|
- "6023:5432"
|
|
command: |
|
|
postgres -c log_statement=all
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"psql postgresql://langchain:langchain@localhost/langchain --command 'SELECT 1;' || exit 1",
|
|
]
|
|
interval: 5s
|
|
retries: 60
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
volumes:
|
|
postgres_data:
|