dendrite/syncapi/storage
Thibaut CHARLES 76e4ebaf78 State events filtering database api (#438)
This PR adds a gomatrixserverlib.Filter parameter to functions handling the syncapi_current_room_state table. It does not implement any filtering logic inside the syncapi IncrementalSync/CompleteSync functions, just the APIs for future use.

Default filters are provided as placeholders in IncrementalSync/CompleteSync, so behaviour should be unchanged (except the default 20 event limit)

SQL table will be changed. You can upgrade an existing database using:

```
ALTER TABLE syncapi_current_room_state  ADD COLUMN IF NOT EXISTS sender text;
UPDATE syncapi_current_room_state SET sender=(event_json::json->>'sender');
ALTER TABLE syncapi_current_room_state ALTER COLUMN sender SET NOT NULL;
ALTER TABLE syncapi_current_room_state  ADD COLUMN IF NOT EXISTS contains_url bool;
UPDATE syncapi_current_room_state SET contains_url=(event_json::json->>'content')::json->>'url' IS NOT NULL;
ALTER TABLE syncapi_current_room_state ALTER COLUMN contains_url SET NOT NULL;
```

Note: This depends on #436 (and includes all its commits). I'm not sure if Github will remove the duplicated commits once #436 is merged.
2019-08-07 11:12:09 +01:00
..
account_data_table.go Add typing notifications to /sync responses - fixes #635 (#718) 2019-07-12 22:59:53 +08:00
current_room_state_table.go State events filtering database api (#438) 2019-08-07 11:12:09 +01:00
filtering.go State events filtering database api (#438) 2019-08-07 11:12:09 +01:00
invites_table.go Fix index in invites_table.go (#770) 2019-07-31 14:36:21 +01:00
output_room_events_table.go State events filtering database api (#438) 2019-08-07 11:12:09 +01:00
syncserver.go State events filtering database api (#438) 2019-08-07 11:12:09 +01:00