You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/.sqlx/query-2f2a82adb60598fcd679e...

28 lines
1.6 KiB
JSON

{
"db_name": "PostgreSQL",
"query": "\n SELECT COUNT(*) AS \"count!\"\n FROM room_members rm\n JOIN users u ON u.id = rm.user_id AND u.deleted_at IS NULL\n LEFT JOIN chat_read_states crs\n ON crs.room_id = rm.room_id\n AND crs.user_id = rm.user_id\n WHERE rm.room_id = $1\n AND ($2::BIGINT IS NULL OR rm.user_id <> $2)\n AND NOT COALESCE((\n (crs.last_read_event_sequence IS NOT NULL\n AND $3::BIGINT IS NOT NULL\n AND crs.last_read_event_sequence >= $3)\n OR (crs.last_read_message_created_at IS NOT NULL\n AND crs.last_read_message_id IS NOT NULL\n AND (crs.last_read_message_created_at, crs.last_read_message_id)\n > ($4, $5))\n OR ($3::BIGINT IS NULL\n AND crs.last_read_message_created_at IS NOT NULL\n AND crs.last_read_message_id IS NOT NULL\n AND (crs.last_read_message_created_at, crs.last_read_message_id)\n = ($4, $5))\n ), FALSE)\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "count!",
"type_info": "Int8",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Int8",
"Int8",
"Int8",
"Timestamptz",
"Int8"
]
},
"nullable": [
null
]
},
"hash": "2f2a82adb60598fcd679e7c62ce5dc310b3180fca8da3ad43d899d6374b53615"
}