dendrite/syncapi/storage/postgres
Kegsay a25d477cdb
Initial syncapi storage refactor to share pq/sqlite code (#1030)
* Initial syncapi storage refactor to share pq/sqlite code

This goes down a different route than https://github.com/matrix-org/dendrite/pull/985
which tried to even reduce the boilerplate of `ExecContext` etc. The previous pattern
fails badly when there are subtle differences in parameters and hence the shared
boilerplate to read from `QueryContext` breaks. Rather than attacking it at that level,
the main place where we want to reuse code is for the `syncserver.go` itself - the
database implementation which has lots of complex logic. So instead, this commit:
 - Makes `invites_table.go` an interface.
 - Makes `SyncServerDatasource` use that interface
 - This means some functions are now identical for pq/sqlite, so factor them out
   to a temporary `shared.Database` struct which will grow until it replaces all of
   `SyncServerDatasource`.

* Missing files
2020-05-13 17:28:42 +01:00
..
account_data_table.go Log errors from rows.Close (#920) 2020-03-18 10:17:18 +00:00
current_room_state_table.go HeaderedEvents in sync API (#922) 2020-03-19 12:07:01 +00:00
filtering.go Implement storage interfaces (#841) 2020-01-03 14:07:05 +00:00
invites_table.go Initial syncapi storage refactor to share pq/sqlite code (#1030) 2020-05-13 17:28:42 +01:00
output_room_events_table.go Fix prev_batch tokens (#999) 2020-05-01 12:41:38 +01:00
output_room_events_topology_table.go Fix prev_batch tokens (#999) 2020-05-01 12:41:38 +01:00
syncserver.go Initial syncapi storage refactor to share pq/sqlite code (#1030) 2020-05-13 17:28:42 +01:00