aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/sqlite3/account_data_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 /syncapi/storage/sqlite3/account_data_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 'syncapi/storage/sqlite3/account_data_table.go')
-rw-r--r--syncapi/storage/sqlite3/account_data_table.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/syncapi/storage/sqlite3/account_data_table.go b/syncapi/storage/sqlite3/account_data_table.go
index de0e72db..eaf52234 100644
--- a/syncapi/storage/sqlite3/account_data_table.go
+++ b/syncapi/storage/sqlite3/account_data_table.go
@@ -66,16 +66,11 @@ func NewSqliteAccountDataTable(db *sql.DB, streamID *StreamIDStatements) (tables
if err != nil {
return nil, err
}
- if s.insertAccountDataStmt, err = db.Prepare(insertAccountDataSQL); err != nil {
- return nil, err
- }
- if s.selectMaxAccountDataIDStmt, err = db.Prepare(selectMaxAccountDataIDSQL); err != nil {
- return nil, err
- }
- if s.selectAccountDataInRangeStmt, err = db.Prepare(selectAccountDataInRangeSQL); err != nil {
- return nil, err
- }
- return s, nil
+ return s, sqlutil.StatementList{
+ {&s.insertAccountDataStmt, insertAccountDataSQL},
+ {&s.selectMaxAccountDataIDStmt, selectMaxAccountDataIDSQL},
+ {&s.selectAccountDataInRangeStmt, selectAccountDataInRangeSQL},
+ }.Prepare(db)
}
func (s *accountDataStatements) InsertAccountData(