Factor out StatementList to sqlutil and use it in userapi

It helps with the boilerplate.
This commit is contained in:
Kegan Dougal 2021-07-28 18:30:04 +01:00
parent 9e4618000e
commit ed4097825b
43 changed files with 145 additions and 264 deletions

View file

@ -23,7 +23,7 @@ import (
"github.com/lib/pq"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/roomserver/storage/shared"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/roomserver/storage/tables"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/util"
@ -79,7 +79,7 @@ func createStateBlockTable(db *sql.DB) error {
func prepareStateBlockTable(db *sql.DB) (tables.StateBlock, error) {
s := &stateBlockStatements{}
return s, shared.StatementList{
return s, sqlutil.StatementList{
{&s.insertStateDataStmt, insertStateDataSQL},
{&s.bulkSelectStateBlockEntriesStmt, bulkSelectStateBlockEntriesSQL},
}.Prepare(db)