{
  "db_name": "PostgreSQL",
  "query": "\n                  INSERT INTO debounce_key (job_id, key)\n                  VALUES ($1, $2)\n                  ON CONFLICT (key)\n                  DO UPDATE SET\n                      previous_job_id = debounce_key.job_id,\n                      job_id = EXCLUDED.job_id, -- replace current job with new one \n                      debounced_times = debounce_key.debounced_times + 1 -- evaluated only if conflict,\n                      -- conflict means there is already existing value,\n                      -- which means overriding it will also imply adding new entry to v2_job_debounce_batch and thus debouncing the job\n                      -- so the counter should be incremented\n                  RETURNING\n                      debounced_times,\n                      first_started_at,\n                      previous_job_id AS job_id_to_debounce\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "debounced_times",
        "type_info": "Int4"
      },
      {
        "ordinal": 1,
        "name": "first_started_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 2,
        "name": "job_id_to_debounce",
        "type_info": "Uuid"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Varchar"
      ]
    },
    "nullable": [
      false,
      false,
      true
    ]
  },
  "hash": "454ace9ce391725ef4f4c129cd66e4c12a5c40f512b70551958178c8b4d6c183"
}
