LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.checkpoint.sqlite_deltabuild_delta_stage2_sql
    Function●Since v3.0

    build_delta_stage2_sql

    Stage-2 per-channel UNION ALL fetching writes from writes.

    One branch per channel with a non-empty chain. Each branch inlines its own IN (?, ?, ...) placeholder list because sqlite has no array-bind equivalent of postgres's = ANY(%s). Caller passes parameters in matching order: [thread_id, checkpoint_ns, channel, *chain_cids] per branch.

    Returns an empty string when no channel has a chain (caller skips executing in that case). Per-channel UNION ALL avoids the over-fetch of a single channel = ANY(channels) filter when channels have different chain depths — same rationale as postgres.

    Copy
    build_delta_stage2_sql(
        *,
        chain_lens: Sequence[int],
    ) -> str
    View source on GitHub