pub const SELECT_PENDING_WAITPOINTS_PAGE_SQL: &str = "SELECT waitpoint_id, waitpoint_key, state, required_signal_names, \
created_at_ms, activated_at_ms, expires_at_ms, token_kid, token \
FROM ff_waitpoint_pending \
WHERE partition_key = ?1 \
AND execution_id = ?2 \
AND state IN ('pending', 'active') \
AND (?3 IS NULL OR waitpoint_id > ?3) \
ORDER BY waitpoint_id \
LIMIT ?4";Expand description
Cursor-paginated scan of ff_waitpoint_pending for one execution.
Filters to state IN ('pending','active') (matches Valkey’s
client-side keep filter). Fetches limit + 1 to detect “more to
come” without a second round-trip.
Binds:
- partition_key (i64)
- execution_id BLOB
- after_waitpoint_id BLOB — NULL → no cursor
- limit_plus_one (i64)