{
  "db_name": "PostgreSQL",
  "query": "\n                WITH\n                    to_delete AS (\n                        SELECT rts_to_del.oauth2_refresh_token_id\n                        FROM oauth2_refresh_tokens rts_to_del\n                        LEFT JOIN oauth2_refresh_tokens next_rts\n                          ON rts_to_del.next_oauth2_refresh_token_id = next_rts.oauth2_refresh_token_id\n                        WHERE rts_to_del.consumed_at IS NOT NULL\n                          AND (rts_to_del.next_oauth2_refresh_token_id IS NULL OR next_rts.consumed_at IS NOT NULL)\n                          AND ($1::timestamptz IS NULL OR rts_to_del.consumed_at >= $1::timestamptz)\n                          AND rts_to_del.consumed_at < $2::timestamptz\n                        ORDER BY rts_to_del.consumed_at ASC\n                        LIMIT $3\n                    ),\n\n                    deleted AS (\n                        DELETE FROM oauth2_refresh_tokens\n                        USING to_delete\n                        WHERE oauth2_refresh_tokens.oauth2_refresh_token_id = to_delete.oauth2_refresh_token_id\n                        RETURNING oauth2_refresh_tokens.consumed_at\n                    )\n\n                SELECT\n                    COUNT(*) as \"count!\",\n                    MAX(consumed_at) as last_consumed_at\n                FROM deleted\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "count!",
        "type_info": "Int8"
      },
      {
        "ordinal": 1,
        "name": "last_consumed_at",
        "type_info": "Timestamptz"
      }
    ],
    "parameters": {
      "Left": [
        "Timestamptz",
        "Timestamptz",
        "Int8"
      ]
    },
    "nullable": [
      null,
      null
    ]
  },
  "hash": "093d42238578771b4183b48c1680ba438b6b18306dfe1454fa4124c0207b3deb"
}
