mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
Add a new function named SupportedDBs.
This function allows the callers to programatically ascertain which database backend drivers are registered and therefore supported.
This commit is contained in:
parent
a2946ea14b
commit
62e38e29e5
10
db.go
10
db.go
@ -206,3 +206,13 @@ func OpenDB(dbtype string, argstr string) (pbdb Db, err error) {
|
||||
}
|
||||
return nil, DbUnknownType
|
||||
}
|
||||
|
||||
// SupportedDBs returns a slice of strings that represent the database drivers
|
||||
// that have been registered and are therefore supported.
|
||||
func SupportedDBs() []string {
|
||||
var supportedDBs []string
|
||||
for _, drv := range driverList {
|
||||
supportedDBs = append(supportedDBs, drv.DbType)
|
||||
}
|
||||
return supportedDBs
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user