aboutsummaryrefslogtreecommitdiff
path: root/federationapi/storage/postgres/queue_json_table.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-03-23 13:52:53 +0100
committerGitHub <noreply@github.com>2023-03-23 13:52:53 +0100
commit234ed603e6b8c7f1f766a002a097007189e1184e (patch)
tree6b7eefa440f2f98e5addee9cbfca6b218a73ef98 /federationapi/storage/postgres/queue_json_table.go
parentcb18ba023084a364a332d09e32ae22d375ed4520 (diff)
Move every `db.Prepare` to `sqlutil.Statementlist`, remove trace driver (#3026)
Doesn't buy us much, but makes everything a bit more consistent. Also removes the SQL trace driver, as it is unused and the output is hard to read anyway.
Diffstat (limited to 'federationapi/storage/postgres/queue_json_table.go')
-rw-r--r--federationapi/storage/postgres/queue_json_table.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/federationapi/storage/postgres/queue_json_table.go b/federationapi/storage/postgres/queue_json_table.go
index e3307418..563738dd 100644
--- a/federationapi/storage/postgres/queue_json_table.go
+++ b/federationapi/storage/postgres/queue_json_table.go
@@ -65,16 +65,11 @@ func NewPostgresQueueJSONTable(db *sql.DB) (s *queueJSONStatements, err error) {
if err != nil {
return
}
- if s.insertJSONStmt, err = s.db.Prepare(insertJSONSQL); err != nil {
- return
- }
- if s.deleteJSONStmt, err = s.db.Prepare(deleteJSONSQL); err != nil {
- return
- }
- if s.selectJSONStmt, err = s.db.Prepare(selectJSONSQL); err != nil {
- return
- }
- return
+ return s, sqlutil.StatementList{
+ {&s.insertJSONStmt, insertJSONSQL},
+ {&s.deleteJSONStmt, deleteJSONSQL},
+ {&s.selectJSONStmt, selectJSONSQL},
+ }.Prepare(db)
}
func (s *queueJSONStatements) InsertQueueJSON(