aboutsummaryrefslogtreecommitdiff
path: root/currentstateserver/storage/postgres/storage.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-09-07 14:47:59 +0100
committerGitHub <noreply@github.com>2020-09-07 14:47:59 +0100
commitc992f4f1f44b0e43e52010b10bc0a82ddf26848d (patch)
tree5468390c58377a69f9ae30b6511667e011256e8a /currentstateserver/storage/postgres/storage.go
parent8589f8373e627f9229e729186ab800d3116c12da (diff)
Remove current state server (#1405)
* Remove current state server Closes #1365 #1272 #1357 * Remove current state server from scripts/docs
Diffstat (limited to 'currentstateserver/storage/postgres/storage.go')
-rw-r--r--currentstateserver/storage/postgres/storage.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/currentstateserver/storage/postgres/storage.go b/currentstateserver/storage/postgres/storage.go
deleted file mode 100644
index cb5ebff0..00000000
--- a/currentstateserver/storage/postgres/storage.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package postgres
-
-import (
- "database/sql"
-
- "github.com/matrix-org/dendrite/currentstateserver/storage/shared"
- "github.com/matrix-org/dendrite/internal/config"
- "github.com/matrix-org/dendrite/internal/sqlutil"
-)
-
-type Database struct {
- shared.Database
- db *sql.DB
- writer sqlutil.Writer
- sqlutil.PartitionOffsetStatements
-}
-
-// NewDatabase creates a new sync server database
-func NewDatabase(dbProperties *config.DatabaseOptions) (*Database, error) {
- var d Database
- var err error
- if d.db, err = sqlutil.Open(dbProperties); err != nil {
- return nil, err
- }
- d.writer = sqlutil.NewDummyWriter()
- if err = d.PartitionOffsetStatements.Prepare(d.db, d.writer, "currentstate"); err != nil {
- return nil, err
- }
- currRoomState, err := NewPostgresCurrentRoomStateTable(d.db)
- if err != nil {
- return nil, err
- }
- d.Database = shared.Database{
- DB: d.db,
- Writer: d.writer,
- CurrentRoomState: currRoomState,
- }
- return &d, nil
-}