langchain/libs/community/tests/unit_tests/document_loaders
Eugene Yurtsev cd52433ba0
community[minor]: Add SQLDatabaseLoader document loader (#18281)
- **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>
2024-02-28 21:02:28 +00:00
..
blob_loaders
loaders
parsers infra: ignore flakey lua test (#17618) 2024-02-16 05:02:58 -07:00
sample_documents
test_docs
__init__.py
test_airbyte.py
test_arcgis_loader.py
test_assemblyai.py
test_base.py langchain[minor],community[minor]: Add async methods in BaseLoader (#16634) 2024-01-31 11:08:11 -08:00
test_bibtex.py
test_bshtml.py
test_confluence.py
test_couchbase.py
test_csv_loader.py
test_cube_semantic.py
test_detect_encoding.py
test_directory.py community[minor]: add exclude parameter to DirectoryLoader (#17316) 2024-02-16 09:42:42 -05:00
test_evernote_loader.py
test_generic_loader.py
test_git.py
test_github.py community[minor]: add github file loader to load any github file content b… (#15305) 2024-02-06 09:42:33 -08:00
test_hugging_face_model.py community[minor]: add hugging_face_model document loader (#17323) 2024-02-28 20:05:35 +00:00
test_hugging_face.py
test_imports.py community[minor]: Add SQLDatabaseLoader document loader (#18281) 2024-02-28 21:02:28 +00:00
test_json_loader.py
test_lakefs.py
test_mediawikidump.py infra: add print rule to ruff (#16221) 2024-02-09 16:13:30 -08:00
test_mhtml.py
test_mongodb.py
test_obsidian.py
test_onenote.py
test_pebblo.py community[minor]: Add pebblo safe document loader (#16862) 2024-02-12 21:56:12 -08:00
test_psychic.py
test_readthedoc.py
test_rspace_loader.py
test_rss.py
test_trello.py
test_web_base.py
test_youtube.py