mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 04:52:46 +00:00
Roomserver perform leave (#1004)
* First pass at PerformLeave * Fix SQLite bulkSelectEventStateKey * Update gomatrixserverlib * Fix bugs * Tidy a bit * Satisfy King Linter * Review comments * Review comments * Fix constants in SQLite event state keys table
This commit is contained in:
parent
df80e42408
commit
9b1b095b49
12 changed files with 394 additions and 14 deletions
|
@ -47,14 +47,14 @@ const selectEventStateKeyNIDSQL = `
|
|||
|
||||
// Bulk lookup from string state key to numeric ID for that state key.
|
||||
// Takes an array of strings as the query parameter.
|
||||
const bulkSelectEventStateKeyNIDSQL = `
|
||||
const bulkSelectEventStateKeySQL = `
|
||||
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
||||
WHERE event_state_key IN ($1)
|
||||
`
|
||||
|
||||
// Bulk lookup from numeric ID to string state key for that state key.
|
||||
// Takes an array of strings as the query parameter.
|
||||
const bulkSelectEventStateKeySQL = `
|
||||
const bulkSelectEventStateKeyNIDSQL = `
|
||||
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
||||
WHERE event_state_key_nid IN ($1)
|
||||
`
|
||||
|
@ -110,7 +110,7 @@ func (s *eventStateKeyStatements) bulkSelectEventStateKeyNID(
|
|||
for k, v := range eventStateKeys {
|
||||
iEventStateKeys[k] = v
|
||||
}
|
||||
selectOrig := strings.Replace(bulkSelectEventStateKeyNIDSQL, "($1)", common.QueryVariadic(len(eventStateKeys)), 1)
|
||||
selectOrig := strings.Replace(bulkSelectEventStateKeySQL, "($1)", common.QueryVariadic(len(eventStateKeys)), 1)
|
||||
|
||||
rows, err := txn.QueryContext(ctx, selectOrig, iEventStateKeys...)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue