exists() — langchain Function Reference
Architecture documentation for the exists() function in _sql_record_manager.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 7cdc3154_7921_569d_0792_e88c88c2da9a["exists()"] 9d7938c1_1c25_4cae_be80_9fc00a5ed077["SQLRecordManager"] 7cdc3154_7921_569d_0792_e88c88c2da9a -->|defined in| 9d7938c1_1c25_4cae_be80_9fc00a5ed077 82b22123_4423_ea4d_765a_075b780b8c2e["_make_session()"] 7cdc3154_7921_569d_0792_e88c88c2da9a -->|calls| 82b22123_4423_ea4d_765a_075b780b8c2e style 7cdc3154_7921_569d_0792_e88c88c2da9a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/indexes/_sql_record_manager.py lines 417–429
def exists(self, keys: Sequence[str]) -> list[bool]:
"""Check if the given keys exist in the SQLite database."""
session: Session
with self._make_session() as session:
filtered_query: Query = session.query(UpsertionRecord.key).filter(
and_(
UpsertionRecord.key.in_(keys),
UpsertionRecord.namespace == self.namespace,
),
)
records = filtered_query.all()
found_keys = {r.key for r in records}
return [k in found_keys for k in keys]
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does exists() do?
exists() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py.
Where is exists() defined?
exists() is defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py at line 417.
What does exists() call?
exists() calls 1 function(s): _make_session.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free