CYPHER_LIST_CHECKPOINTS = '\nMATCH (
t:Thread {thread_id: $thread_id, checkpoint_ns: $checkpoint_ns})\n -[:HAS_CHECKPOINT]->(c:Checkpoint)\nWHERE $before_id IS NULL OR c.checkpoint_id < $before_id\nWITH t, c ORDER BY c.checkpoint_id DESC LIMIT $limit\nOPTIONAL MATCH (c)-[:PREVIOUS]->(parent:Checkpoint
)\nRETURN t.thread_id as thread_id,\n t.checkpoint_ns as checkpoint_ns,\n c.checkpoint_id as checkpoint_id,\n parent.checkpoint_id as parent_checkpoint_id,\n c.type as type,\n c.checkpoint as checkpoint,\n c.metadata as metadata\n'