@name DeleteUserDataResult DeleteUserData wipes everything tied to a user in a single transaction. Schema cascades cover most of it (user_sessions, domains, agent_identities, api_keys, usage_summaries all `ON DELETE CASCADE` from users; messages cascade through agent_identities; webhook_deliveries
(ctx context.Context, userID string)
| 263 | // Per-table counts are returned to the caller so an operator can attest |
| 264 | // to what was removed in audit / compliance contexts. |
| 265 | func (s *Store) DeleteUserData(ctx context.Context, userID string) (*DeleteUserDataResult, error) { |
| 266 | return s.DeleteUserDataTx(ctx, userID, nil) |
| 267 | } |
| 268 | |
| 269 | // DeleteUserDataTx is DeleteUserData with an optional per-domain in-tx hook |
| 270 | // run for every domain the user owns, BEFORE the cascade deletes them. It is |