{
  "db_name": "PostgreSQL",
  "query": "\n          WITH RECURSIVE parents AS (\n            SELECT m.member_account_set_id, m.account_set_id\n            FROM cala_account_set_member_account_sets m\n            JOIN cala_account_sets s\n            ON s.id = m.account_set_id\n            WHERE m.member_account_set_id = $1\n\n            UNION ALL\n            SELECT p.member_account_set_id, m.account_set_id\n            FROM parents p\n            JOIN cala_account_set_member_account_sets m\n                ON p.account_set_id = m.member_account_set_id\n          ),\n          member_accounts_deletion AS (\n            DELETE FROM cala_account_set_member_accounts\n            WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n            AND member_account_id IN (SELECT member_account_id FROM cala_account_set_member_accounts\n                                      WHERE account_set_id = $2)\n          ),\n          member_account_set_deletion AS (\n            DELETE FROM cala_account_set_member_account_sets\n            WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n            AND member_account_set_id = $2\n          )\n          SELECT account_set_id, NULL AS now\n          FROM parents\n          UNION ALL\n          SELECT NULL AS account_set_id, NOW() AS now\n          ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "account_set_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "now",
        "type_info": "Timestamptz"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Uuid"
      ]
    },
    "nullable": [
      null,
      null
    ]
  },
  "hash": "1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587"
}
