Class SpannerLoader (0.9.0)
SpannerLoader(
instance_id: str,
database_id: str,
query: str,
content_columns: typing.List[str] = [],
metadata_columns: typing.List[str] = [],
format: str = "text",
databoost: bool = False,
metadata_json_column: str = "langchain_metadata",
staleness: typing.Union[float, datetime.datetime] = 0.0,
client: typing.Optional[google.cloud.spanner_v1.client.Client] = None,
)
Loads data from Google Cloud Spanner.
Methods
SpannerLoader
SpannerLoader(
instance_id: str,
database_id: str,
query: str,
content_columns: typing.List[str] = [],
metadata_columns: typing.List[str] = [],
format: str = "text",
databoost: bool = False,
metadata_json_column: str = "langchain_metadata",
staleness: typing.Union[float, datetime.datetime] = 0.0,
client: typing.Optional[google.cloud.spanner_v1.client.Client] = None,
)
Initialize Spanner document loader.
lazy_load
lazy_load() -> typing.Iterator[langchain_core.documents.base.Document]
A lazy loader for langchain documents from a Spanner database. Use lazy load to avoid
caching all documents in memory at once.
Returns |
Type |
Description |
(Iterator[langchain_core.documents.Document]) |
a list of Documents with metadata from specific columns. |
load
load() -> typing.List[langchain_core.documents.base.Document]
Load langchain documents from a Spanner database.
Returns |
Type |
Description |
(List[langchain_core.documents.Document]) |
a list of Documents with metadata from specific columns. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class SpannerLoader (0.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.9.0 (latest)](/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.loader.SpannerLoader)\n- [0.8.2](/python/docs/reference/langchain-google-spanner/0.8.2/langchain_google_spanner.loader.SpannerLoader)\n- [0.7.0](/python/docs/reference/langchain-google-spanner/0.7.0/langchain_google_spanner.loader.SpannerLoader)\n- [0.6.0](/python/docs/reference/langchain-google-spanner/0.6.0/langchain_google_spanner.loader.SpannerLoader)\n- [0.5.0](/python/docs/reference/langchain-google-spanner/0.5.0/langchain_google_spanner.loader.SpannerLoader)\n- [0.4.1](/python/docs/reference/langchain-google-spanner/0.4.1/langchain_google_spanner.loader.SpannerLoader)\n- [0.3.0](/python/docs/reference/langchain-google-spanner/0.3.0/langchain_google_spanner.loader.SpannerLoader) \n\n SpannerLoader(\n instance_id: str,\n database_id: str,\n query: str,\n content_columns: typing.List[str] = [],\n metadata_columns: typing.List[str] = [],\n format: str = \"text\",\n databoost: bool = False,\n metadata_json_column: str = \"langchain_metadata\",\n staleness: typing.Union[float, datetime.datetime] = 0.0,\n client: typing.Optional[google.cloud.spanner_v1.client.Client] = None,\n )\n\nLoads data from Google Cloud Spanner.\n\nMethods\n-------\n\n### SpannerLoader\n\n SpannerLoader(\n instance_id: str,\n database_id: str,\n query: str,\n content_columns: typing.List[str] = [],\n metadata_columns: typing.List[str] = [],\n format: str = \"text\",\n databoost: bool = False,\n metadata_json_column: str = \"langchain_metadata\",\n staleness: typing.Union[float, datetime.datetime] = 0.0,\n client: typing.Optional[google.cloud.spanner_v1.client.Client] = None,\n )\n\nInitialize Spanner document loader.\n\n### lazy_load\n\n lazy_load() -\u003e typing.Iterator[langchain_core.documents.base.Document]\n\nA lazy loader for langchain documents from a Spanner database. Use lazy load to avoid\ncaching all documents in memory at once.\n\n### load\n\n load() -\u003e typing.List[langchain_core.documents.base.Document]\n\nLoad langchain documents from a Spanner database."]]