Fix error in "rowsToStreamEvent"

Add columns device_id, transaction_id to select statement.
This matches the subsequent call to Scan() and thus prevents the error.

Signed-off-by: Maximilian Seifert <max.seifert@drglitch.net>
This commit is contained in:
Maximilian Seifert 2019-03-26 20:19:52 +01:00
parent 6147c72663
commit 731eee377d

View file

@ -67,10 +67,12 @@ const insertEventSQL = "" +
") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id" ") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id"
const selectEventsSQL = "" + const selectEventsSQL = "" +
"SELECT id, event_json FROM syncapi_output_room_events WHERE event_id = ANY($1)" "SELECT id, event_json, device_id, transaction_id" +
" FROM syncapi_output_room_events WHERE event_id = ANY($1)"
const selectRecentEventsSQL = "" + const selectRecentEventsSQL = "" +
"SELECT id, event_json, device_id, transaction_id FROM syncapi_output_room_events" + "SELECT id, event_json, device_id, transaction_id" +
" FROM syncapi_output_room_events" +
" WHERE room_id = $1 AND id > $2 AND id <= $3" + " WHERE room_id = $1 AND id > $2 AND id <= $3" +
" ORDER BY id DESC LIMIT $4" " ORDER BY id DESC LIMIT $4"