SQLDatabaseLoader(
self,
query: Union[str, Select],
db: SQLDatabase,| Name | Type | Description |
|---|---|---|
query* | Union[str, Select] | The query to execute. |
db* | SQLDatabase | A LangChain |
sqlalchemy_kwargs* | unknown | More keyword arguments for SQLAlchemy's |
parameters | Optional[Dict[str, Any]] | Default: None |
page_content_mapper | Optional[Callable[..., str]] | Default: None |
metadata_mapper | Optional[Callable[..., Dict[str, Any]]] | Default: None |
source_columns | Optional[Sequence[str]] | Default: None |
include_rownum_into_metadata | bool | Default: False |
include_query_into_metadata | bool | Default: False |
Load documents by querying database tables supported by SQLAlchemy.
For talking to the database, the document loader uses the SQLDatabase
utility from the LangChain integration toolkit.
Each document represents one row of the result.
Optional. Parameters to pass to the query.
Optional. Function to convert a row into a string
to use as the page_content of the document. By default, the loader
serializes the whole row into a string, including all columns.
Optional. Function to convert a row into a dictionary
to use as the metadata of the document. By default, no columns are
selected into the metadata dictionary.
Optional. The names of the columns to use as the source
within the metadata dictionary.
Optional. Whether to include the row number into the metadata dictionary. Default: False.
Optional. Whether to include the query expression into the metadata dictionary. Default: False.