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.
This commit is contained in:
Till 2023-03-23 13:52:53 +01:00 committed by GitHub
parent cb18ba0230
commit 234ed603e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 127 additions and 451 deletions

View file

@ -72,13 +72,10 @@ func NewPostgresServerSigningKeysTable(db *sql.DB) (s *serverSigningKeyStatement
if err != nil {
return
}
if s.bulkSelectServerKeysStmt, err = db.Prepare(bulkSelectServerSigningKeysSQL); err != nil {
return
}
if s.upsertServerKeysStmt, err = db.Prepare(upsertServerSigningKeysSQL); err != nil {
return
}
return s, nil
return s, sqlutil.StatementList{
{&s.bulkSelectServerKeysStmt, bulkSelectServerSigningKeysSQL},
{&s.upsertServerKeysStmt, upsertServerSigningKeysSQL},
}.Prepare(db)
}
func (s *serverSigningKeyStatements) BulkSelectServerKeys(