Skip to content

Commit 7cb22ce

Browse files
committed
session: embed db.BaseDB in SQLStore
So that we can extract the same BaseDB in other packages and use it for initialising other SQL stores during tests.
1 parent a978c80 commit 7cb22ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

session/sql_store.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ type SQLStore struct {
6565
// in order to implement all its CRUD logic.
6666
db BatchedSQLQueries
6767

68-
// DB represents the underlying database connection.
69-
*sql.DB
68+
// BaseDB represents the underlying database connection.
69+
*db.BaseDB
7070

7171
clock clock.Clock
7272
}
@@ -81,9 +81,9 @@ func NewSQLStore(sqlDB *db.BaseDB, clock clock.Clock) *SQLStore {
8181
)
8282

8383
return &SQLStore{
84-
db: executor,
85-
DB: sqlDB.DB,
86-
clock: clock,
84+
db: executor,
85+
BaseDB: sqlDB,
86+
clock: clock,
8787
}
8888
}
8989

0 commit comments

Comments
 (0)