TiDB Cloud, is a comprehensive Database-as-a-Service (DBaaS) solution, that provides dedicated and serverless options. TiDB Serverless is now integrating a built-in vector search into the MySQL landscape. With this enhancement, you can seamlessly develop AI applications using TiDB Serverless without the need for a new database or additional technical stacks. Be among the first to experience it by joining the waitlist for the private beta at https://tidb.cloud/ai.This notebook introduces how to use
TiDBLoader
to load data from TiDB in langchain.
TiDBLoader
, we will install the following dependencies:
TiDBLoader
:
query
(str): This is the SQL query to be executed against the TiDB database. The query should select the data you want to load into your Document
objects.
For instance, you might use a query like "SELECT * FROM my_table"
to fetch all data from my_table
.
page_content_columns
(Optional[List[str]]): Specifies the list of column names whose values should be included in the page_content
of each Document
object.
If set to None
(the default), all columns returned by the query are included in page_content
. This allows you to tailor the content of each document based on specific columns of your data.
metadata_columns
(Optional[List[str]]): Specifies the list of column names whose values should be included in the metadata
of each Document
object.
By default, this list is empty, meaning no metadata will be included unless explicitly specified. This is useful for including additional information about each document that doesn’t form part of the main content but is still valuable for processing or analysis.