{
  "db_name": "PostgreSQL",
  "query": "\n            SELECT DISTINCT dg.deployment_id\n            FROM user_groups ug\n            INNER JOIN deployment_groups dg ON ug.group_id = dg.group_id\n            INNER JOIN api_keys ak ON ug.user_id = ak.user_id\n            WHERE ak.id = $1\n\n            UNION\n\n            SELECT DISTINCT dg.deployment_id\n            FROM deployment_groups dg\n            INNER JOIN api_keys ak ON dg.group_id = '00000000-0000-0000-0000-000000000000'\n            WHERE ak.id = $1\n            AND ak.user_id != '00000000-0000-0000-0000-000000000000'  -- Exclude system user\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "deployment_id",
        "type_info": "Uuid"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid"
      ]
    },
    "nullable": [
      null
    ]
  },
  "hash": "474a783e2baafeafe3e440ded4d47f43a97e4b8ed436f027ed7054d2fc3b7e0d"
}
