{
  "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 = CASE WHEN EXISTS\n                    (SELECT 1 FROM v2_job_queue q WHERE q.id = debounce_key.job_id AND q.running)\n                    THEN NULL ELSE debounce_key.job_id END,\n                job_id = EXCLUDED.job_id,\n                debounced_times = CASE WHEN EXISTS\n                    (SELECT 1 FROM v2_job_queue q WHERE q.id = debounce_key.job_id AND q.running)\n                    THEN 0 ELSE debounce_key.debounced_times + 1 END,\n                first_started_at = CASE WHEN EXISTS\n                    (SELECT 1 FROM v2_job_queue q WHERE q.id = debounce_key.job_id AND q.running)\n                    THEN now() ELSE debounce_key.first_started_at END\n            RETURNING debounced_times, first_started_at, 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": "f44595adab2d127c83f9829b74429dcb7e5f2513bc59c2bdf7dd0be1864cd2c5"
}
