{ "db_name": "PostgreSQL", "query": "select\n id,\n workspace_id,\n agent_id,\n operation_id,\n protocol,\n mode,\n status,\n cursor_json,\n state_json,\n to_char(expires_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"expires_at!\",\n to_char(last_poll_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as last_poll_at,\n to_char(created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n to_char(closed_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as closed_at\n from stream_sessions\n where workspace_id = $1\n and ($2::text is null or agent_id = $2)\n and ($3::text is null or operation_id = $3)\n and ($4::text is null or status = $4)\n and ($5::text is null or mode = $5)\n order by created_at desc\n limit $6", "describe": { "columns": [ { "ordinal": 0, "name": "id", "type_info": "Text" }, { "ordinal": 1, "name": "workspace_id", "type_info": "Text" }, { "ordinal": 2, "name": "agent_id", "type_info": "Text" }, { "ordinal": 3, "name": "operation_id", "type_info": "Text" }, { "ordinal": 4, "name": "protocol", "type_info": "Text" }, { "ordinal": 5, "name": "mode", "type_info": "Text" }, { "ordinal": 6, "name": "status", "type_info": "Text" }, { "ordinal": 7, "name": "cursor_json", "type_info": "Jsonb" }, { "ordinal": 8, "name": "state_json", "type_info": "Jsonb" }, { "ordinal": 9, "name": "expires_at!", "type_info": "Text" }, { "ordinal": 10, "name": "last_poll_at", "type_info": "Text" }, { "ordinal": 11, "name": "created_at!", "type_info": "Text" }, { "ordinal": 12, "name": "closed_at", "type_info": "Text" } ], "parameters": { "Left": [ "Text", "Text", "Text", "Text", "Text", "Int8" ] }, "nullable": [ false, false, true, false, false, false, false, true, false, null, null, null, null ] }, "hash": "4e2091cb75e67ac455b0efee795e94b8a18807a59a0f11796fec27519f34817d" }