2019-08-21 15:32:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package storagenodedb
|
|
|
|
|
2021-04-23 10:52:40 +01:00
|
|
|
import "storj.io/private/tagsql"
|
2020-01-30 19:38:25 +00:00
|
|
|
|
2020-01-19 14:41:23 +00:00
|
|
|
// dbContainerImpl fulfills the migrate.DB interface and the SQLDB interface.
|
2019-11-13 16:49:22 +00:00
|
|
|
type dbContainerImpl struct {
|
2020-01-30 19:38:25 +00:00
|
|
|
tagsql.DB
|
2019-09-18 17:17:28 +01:00
|
|
|
}
|
2019-08-21 15:32:25 +01:00
|
|
|
|
2019-09-18 17:17:28 +01:00
|
|
|
// Configure sets the underlining SQLDB connection.
|
2020-01-30 19:38:25 +00:00
|
|
|
func (db *dbContainerImpl) Configure(newDB tagsql.DB) {
|
|
|
|
db.DB = newDB
|
2019-09-23 20:36:46 +01:00
|
|
|
}
|
|
|
|
|
2020-01-19 14:41:23 +00:00
|
|
|
// GetDB returns underlying implementation of dbContainerImpl.
|
2020-01-30 19:38:25 +00:00
|
|
|
func (db *dbContainerImpl) GetDB() tagsql.DB {
|
|
|
|
return db.DB
|
2019-09-18 17:17:28 +01:00
|
|
|
}
|