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

    Chat LangChain

    What can I help with?

    Enter to send·Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    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.1

    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],
      has_task_path: bool = True
    ) -> str
    View source on GitHub