aboutsummaryrefslogtreecommitdiff
path: root/publicroomsapi/storage
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-01-24 17:11:20 +0000
committerGitHub <noreply@github.com>2020-01-24 17:11:20 +0000
commit37d117f2b7db9d04c0d6ee0e71baaad8d6680ddd (patch)
tree984affd8fabd18eb5f959ac08abd18d58f692e3b /publicroomsapi/storage
parentdece31f41ee096712a4415f09f4f9725068efe9d (diff)
Wire up publicroomsapi for roomserver events (#851)
* Wire up publicroomsapi to roomserver events * Remove parameter that was incorrectly brought over from p2p work * nolint containsBackwardExtremity for now
Diffstat (limited to 'publicroomsapi/storage')
-rw-r--r--publicroomsapi/storage/postgres/storage.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/publicroomsapi/storage/postgres/storage.go b/publicroomsapi/storage/postgres/storage.go
index 67b5efc3..5365c766 100644
--- a/publicroomsapi/storage/postgres/storage.go
+++ b/publicroomsapi/storage/postgres/storage.go
@@ -42,15 +42,16 @@ func NewPublicRoomsServerDatabase(dataSourceName string) (*PublicRoomsServerData
if db, err = sql.Open("postgres", dataSourceName); err != nil {
return nil, err
}
- partitions := common.PartitionOffsetStatements{}
- if err = partitions.Prepare(db, "publicroomsapi"); err != nil {
+ storage := PublicRoomsServerDatabase{
+ db: db,
+ }
+ if err = storage.PartitionOffsetStatements.Prepare(db, "publicroomsapi"); err != nil {
return nil, err
}
- statements := publicRoomsStatements{}
- if err = statements.prepare(db); err != nil {
+ if err = storage.statements.prepare(db); err != nil {
return nil, err
}
- return &PublicRoomsServerDatabase{db, partitions, statements}, nil
+ return &storage, nil
}
// GetRoomVisibility returns the room visibility as a boolean: true if the room