Method SoftDelete_DeleteCompletedTrashContainer()
Physically delete one batch of objects from a trash container (children of $1).
FK ON DELETE CASCADE handles _values. Progress kept on the container (_key
cumulative, _value_string status); this batch's count is stashed in the
container's _value_double so the final SELECT can return it (changes() can't be
read after the progress UPDATE). The empty container is left as a 'completed'
marker (scheme -10, invisible to normal queries) — PG deletes it; cosmetic.
References (_values._Object, a foreign key with no ON DELETE action): a reference held by
a trashed object is removed with the batch, so the order containers are purged in never
matters; an object referenced by a live object is skipped - never deleted, never unlinked.
When only such objects are left the container is marked 'failed' and the background
worker stops claiming it. The batch is chosen twice by the same ordered predicate - the
reference removal in between touches no live holder, so both picks are the same rows.
No transaction in the text (see ): the provider runs
the batch inside one.
Params: $1=trashId, $2=batchSize. Returns: deleted_count, remaining_count.
public string? SoftDelete_DeleteCompletedTrashContainer()