Skip to content

Commit f94b1ea

Browse files
authored
Merge pull request #8542 from dolthub/liuliu/pass-databaseName-to-DoltDBFromCS
liuliu/return databasename
2 parents e0bb687 + cc3c252 commit f94b1ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

go/libraries/doltcore/doltdb/doltdb.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ func DoltDBFromCS(cs chunks.ChunkStore, databaseName string) *DoltDB {
9797
return &DoltDB{db: hooksDatabase{Database: db}, vrw: vrw, ns: ns, databaseName: databaseName}
9898
}
9999

100+
// GetDatabaseName returns the name of the database.
101+
// Note: This can return an empty string if the database name is not populated.
102+
func (ddb *DoltDB) GetDatabaseName() string {
103+
return ddb.databaseName
104+
}
105+
100106
// HackDatasDatabaseFromDoltDB unwraps a DoltDB to a datas.Database.
101107
// Deprecated: only for use in dolt migrate.
102108
func HackDatasDatabaseFromDoltDB(ddb *DoltDB) datas.Database {

0 commit comments

Comments
 (0)