mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-03 14:42:47 +00:00
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:
parent
cb18ba0230
commit
234ed603e6
33 changed files with 127 additions and 451 deletions
|
@ -52,13 +52,11 @@ func NewPostgresIgnoresTable(db *sql.DB) (tables.Ignores, error) {
|
|||
return nil, err
|
||||
}
|
||||
s := &ignoresStatements{}
|
||||
if s.selectIgnoresStmt, err = db.Prepare(selectIgnoresSQL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.upsertIgnoresStmt, err = db.Prepare(upsertIgnoresSQL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
|
||||
return s, sqlutil.StatementList{
|
||||
{&s.selectIgnoresStmt, selectIgnoresSQL},
|
||||
{&s.upsertIgnoresStmt, upsertIgnoresSQL},
|
||||
}.Prepare(db)
|
||||
}
|
||||
|
||||
func (s *ignoresStatements) SelectIgnores(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue