mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +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
|
@ -78,16 +78,11 @@ func NewPostgresAccountDataTable(db *sql.DB) (tables.AccountData, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.insertAccountDataStmt, err = db.Prepare(insertAccountDataSQL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.selectAccountDataInRangeStmt, err = db.Prepare(selectAccountDataInRangeSQL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.selectMaxAccountDataIDStmt, err = db.Prepare(selectMaxAccountDataIDSQL); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
return s, sqlutil.StatementList{
|
||||
{&s.insertAccountDataStmt, insertAccountDataSQL},
|
||||
{&s.selectAccountDataInRangeStmt, selectAccountDataInRangeSQL},
|
||||
{&s.selectMaxAccountDataIDStmt, selectMaxAccountDataIDSQL},
|
||||
}.Prepare(db)
|
||||
}
|
||||
|
||||
func (s *accountDataStatements) InsertAccountData(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue