mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Query update
This commit is contained in:
parent
44c53e32f8
commit
fdb65e52b7
|
|
@ -103,7 +103,7 @@ const updateEventJSONSQL = "" +
|
||||||
"UPDATE syncapi_output_room_events SET headered_event_json=$1 WHERE event_id=$2"
|
"UPDATE syncapi_output_room_events SET headered_event_json=$1 WHERE event_id=$2"
|
||||||
|
|
||||||
const selectCountStateChangesInRangeSQL = "" +
|
const selectCountStateChangesInRangeSQL = "" +
|
||||||
"SELECT COUNT(*), MIN(id), MAX(id) FROM syncapi_output_room_events" +
|
"SELECT COUNT(id), COALESCE(MIN(id), 0) AS min, COALESCE(MAX(id), 0) AS max FROM syncapi_output_room_events" +
|
||||||
" WHERE (id > $1 AND id <= $2) AND (cardinality (add_state_ids) > 0 OR cardinality (remove_state_ids) > 0)"
|
" WHERE (id > $1 AND id <= $2) AND (cardinality (add_state_ids) > 0 OR cardinality (remove_state_ids) > 0)"
|
||||||
|
|
||||||
// In order for us to apply the state updates correctly, rows need to be ordered in the order they were received (id).
|
// In order for us to apply the state updates correctly, rows need to be ordered in the order they were received (id).
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ const updateEventJSONSQL = "" +
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const selectCountStateChangesInRangeSQL = "" +
|
const selectCountStateChangesInRangeSQL = "" +
|
||||||
"SELECT COUNT(*), coalesce(MIN(id), 0) AS min, coalesce(MAX(id), 0) AS max FROM syncapi_output_room_events" +
|
"SELECT COUNT(*), MIN(id), MAX(id) AS max FROM syncapi_output_room_events" +
|
||||||
" WHERE (id > $1 AND id <= $2) AND ((add_state_ids IS NULL OR add_state_ids = '') OR (remove_state_ids IS NULL OR remove_state_ids = ''))"
|
" WHERE (id > $1 AND id <= $2) AND ((add_state_ids IS NULL OR add_state_ids = '') OR (remove_state_ids IS NULL OR remove_state_ids = ''))"
|
||||||
|
|
||||||
const selectStateInRangeSQL = "" +
|
const selectStateInRangeSQL = "" +
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue