2019-08-21 15:32:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package storagenodedb
|
|
|
|
|
2019-11-13 16:49:22 +00:00
|
|
|
// dbContainerImpl fulfills the migrate.DB interface and the SQLDB interface
|
|
|
|
type dbContainerImpl struct {
|
|
|
|
SQLDB
|
2019-08-21 15:32:25 +01:00
|
|
|
}
|
|
|
|
|
2019-09-18 17:17:28 +01:00
|
|
|
// Schema returns schema
|
|
|
|
// These are implemented because the migrate.DB interface requires them.
|
|
|
|
// Maybe in the future we should untangle those.
|
2019-11-13 16:49:22 +00:00
|
|
|
func (db *dbContainerImpl) Schema() string {
|
2019-09-18 17:17:28 +01:00
|
|
|
return ""
|
2019-08-21 15:32:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Rebind rebind parameters
|
|
|
|
// These are implemented because the migrate.DB interface requires them.
|
|
|
|
// Maybe in the future we should untangle those.
|
2019-11-13 16:49:22 +00:00
|
|
|
func (db *dbContainerImpl) Rebind(s string) string {
|
2019-09-18 17:17:28 +01:00
|
|
|
return s
|
|
|
|
}
|
2019-08-21 15:32:25 +01:00
|
|
|
|
2019-09-18 17:17:28 +01:00
|
|
|
// Configure sets the underlining SQLDB connection.
|
2019-11-13 16:49:22 +00:00
|
|
|
func (db *dbContainerImpl) Configure(sqlDB SQLDB) {
|
|
|
|
db.SQLDB = sqlDB
|
2019-09-23 20:36:46 +01:00
|
|
|
}
|
|
|
|
|
2019-11-13 16:49:22 +00:00
|
|
|
// GetDB returns the raw *sql.DB underlying this dbContainerImpl
|
|
|
|
func (db *dbContainerImpl) GetDB() SQLDB {
|
|
|
|
return db.SQLDB
|
2019-09-18 17:17:28 +01:00
|
|
|
}
|