// SPDX-License-Identifier: BUSL-1.1
//! Schedule enumeration for `PurgeCollection` cascade.
//!
//! Schedules may reference a specific target collection via
//! `target_collection: Option<String>`. When `Some`, the schedule
//! becomes invalid on collection hard-delete and must be dropped.
//!
//! Schedules with `target_collection = None` run an opaque SQL body
//! that may or may not reference the collection. We cannot cheaply
//! enumerate those without parsing every body — the orchestrator
//! handles that case via `CASCADE FORCE` (accept the risk and purge
//! anyway; the next scheduler tick will log a failure).
use crateSystemCatalog;
/// Enumerate schedules whose `target_collection` matches
/// `(tenant_id, collection)`. Returns schedule names only, sorted.
/// Opaque-body schedules (`target_collection = None`) are excluded
/// by construction — callers that need them must use CASCADE FORCE.