{
  "db_name": "PostgreSQL",
  "query": "\n              WITH dk AS (\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,\n                      debounced_times = debounce_key.debounced_times + 1\n                  RETURNING\n                      debounced_times,\n                      first_started_at,\n                      previous_job_id AS job_id_to_debounce\n              ), _batch AS (\n                  INSERT INTO v2_job_debounce_batch (id, debounce_batch)\n                  SELECT\n                      $1,\n                      COALESCE(\n                          (SELECT debounce_batch FROM v2_job_debounce_batch WHERE id = dk.job_id_to_debounce LIMIT 1),\n                          nextval('debounce_batch_seq')\n                      )\n                  FROM dk\n              )\n              SELECT debounced_times, first_started_at, job_id_to_debounce FROM dk\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": "c2347460b73ae9d3167031c263032e97ebefb46be9e58bd3da9067748075311b"
}
