UpsertionRecord Class — langchain Architecture
Architecture documentation for the UpsertionRecord class in _sql_record_manager.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1a256e96_676d_821c_2976_b0f2b00013b4["UpsertionRecord"] 8bffe3e4_4cad_6b21_a587_b60824b34a04["_sql_record_manager.py"] 1a256e96_676d_821c_2976_b0f2b00013b4 -->|defined in| 8bffe3e4_4cad_6b21_a587_b60824b34a04
Relationship Graph
Source Code
libs/langchain/langchain_classic/indexes/_sql_record_manager.py lines 53–82
class UpsertionRecord(Base): # type: ignore[valid-type,misc]
"""Table used to keep track of when a key was last updated."""
# ATTENTION:
# Prior to modifying this table, please determine whether
# we should create migrations for this table to make sure
# users do not experience data loss.
__tablename__ = "upsertion_record"
uuid = Column(
String,
index=True,
default=lambda: str(uuid.uuid4()),
primary_key=True,
nullable=False,
)
key = Column(String, index=True)
# Using a non-normalized representation to handle `namespace` attribute.
# If the need arises, this attribute can be pulled into a separate Collection
# table at some time later.
namespace = Column(String, index=True, nullable=False)
group_id = Column(String, index=True, nullable=True)
# The timestamp associated with the last record upsertion.
updated_at = Column(Float, index=True)
__table_args__ = (
UniqueConstraint("key", "namespace", name="uix_key_namespace"),
Index("ix_key_namespace", "key", "namespace"),
)
Source
Frequently Asked Questions
What is the UpsertionRecord class?
UpsertionRecord is a class in the langchain codebase, defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py.
Where is UpsertionRecord defined?
UpsertionRecord is defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py at line 53.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free