More wiring/boilerplate

This commit is contained in:
Neil Alexander 2021-07-28 14:29:02 +01:00
parent a3962bd9b8
commit cd59f54af7
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
15 changed files with 101 additions and 16 deletions

View file

@ -53,7 +53,7 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*shared.Database, error)
if err != nil {
return nil, err
}
return &shared.Database{
d := &shared.Database{
DB: db,
Writer: sqlutil.NewExclusiveWriter(),
OneTimeKeysTable: otk,
@ -63,5 +63,9 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*shared.Database, error)
CrossSigningKeysTable: csk,
CrossSigningSigsTable: css,
CrossSigningStreamsTable: cst,
}, nil
}
if err = d.PartitionOffsetStatements.Prepare(db, d.Writer, "keyserver"); err != nil {
return nil, err
}
return d, nil
}