> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arcyria.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete handling

> How deleted source rows reach the destination for each sync mode.

Destination delivery is Upsert-only, so deleted source rows are not removed
automatically.

| Sync mode | Deleted source rows | Option |
| - | - | - |
| Full table | Stay in the destination | None |
| Incremental (cursor) | Not visible to the cursor; stay in the destination | Delete detection |
| CDC (PostgreSQL) | Captured from the WAL in each run | Hard delete (default), soft delete, or skip |

| Sync mode | `TRUNCATE` on the source |
| - | - |
| Full table | Not seen; destination rows stay |
| Incremental | Not seen; destination rows stay |
| CDC | Captured. The stream's truncate policy decides: stop and ask (default), ignore, or truncate the destination |

For CDC, deletes and truncates apply only to destinations whose key is the
source key and whose model reads only that stream. Soft delete needs a boolean
`_arcyria_deleted` column. MongoDB destinations support hard delete only. See
[PostgreSQL CDC setup](https://docs.arcyria.com/sync-reference/cdc-postgresql.md).

## Delete detection

Delete detection is off by default. When you enable it on an Incremental
stream, a successful run checks on a schedule (every 24 hours by default)
whether each destination key still exists in the source. Destination rows whose
key is missing are then:

* **Soft delete**: marked with `_arcyria_deleted = true`, plus
  `_arcyria_deleted_at` if that column exists. The destination table must have
  a boolean `_arcyria_deleted` column. If the key returns to the source, the
  flag is cleared.
* **Hard delete**: removed from the destination table.

Requirements:

* the stream has a primary key;
* the destination Upsert key is the same columns as the source primary key;
* the destination model reads only that stream; and
* the destination is PostgreSQL, MySQL, or MongoDB (hard delete only).

For a MongoDB source, the key is `_id`, so the destination key must be `_id`.

Destinations that do not meet these requirements are skipped and the run
records the reason. Arcyria refuses a check that would remove more than half of
a destination's rows, because that usually means the source is wrong or empty.
Delete detection never fails a run.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.