LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicindexes_sql_record_managerSQLRecordManager
    Class●Since v1.0

    SQLRecordManager

    Copy
    SQLRecordManager(
      self,
      namespace: str,
      *,
      engine: Engine | AsyncEngine | 

    Bases

    RecordManager

    Constructors

    Attributes

    Methods

    Inherited fromRecordManager(langchain_core)

    Attributes

    Anamespace
    View source on GitHub
    None
    =
    None
    ,
    db_url
    :
    None
    |
    str
    |
    URL
    =
    None
    ,
    engine_kwargs
    :
    dict
    [
    str
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    async_mode
    :
    bool
    =
    False
    )

    Parameters

    NameTypeDescription
    namespace*str

    The namespace associated with this record manager.

    engineEngine | AsyncEngine | None
    Default:None

    An already existing SQL Alchemy engine.

    db_urlNone | str | URL
    Default:None

    A database connection string used to create an SQL Alchemy engine.

    engine_kwargsdict[str, Any] | None
    Default:None
    async_modebool
    Default:False
    constructor
    __init__
    NameType
    namespacestr
    engineEngine | AsyncEngine | None
    db_urlNone | str | URL
    engine_kwargsdict[str, Any] | None
    async_modebool
    attribute
    engine: _engine
    attribute
    dialect
    attribute
    session_factory: _session_factory
    method
    create_schema

    Create the database schema.

    method
    acreate_schema

    Create the database schema.

    method
    get_time

    Get the current server time as a timestamp.

    Please note it's critical that time is obtained from the server since we want a monotonic clock.

    method
    aget_time

    Get the current server time as a timestamp.

    Please note it's critical that time is obtained from the server since we want a monotonic clock.

    method
    update

    Upsert records into the SQLite database.

    method
    aupdate

    Upsert records into the SQLite database.

    method
    exists

    Check if the given keys exist in the SQLite database.

    method
    aexists

    Check if the given keys exist in the SQLite database.

    method
    list_keys

    List records in the SQLite database based on the provided date range.

    method
    alist_keys

    List records in the SQLite database based on the provided date range.

    method
    delete_keys

    Delete records from the SQLite database.

    method
    adelete_keys

    Delete records from the SQLite database.

    A SQL Alchemy based implementation of the record manager.

    Additional keyword arguments to be passed when creating the engine.

    Whether to create an async engine. Driver should support async operations. It only applies if db_url is provided.