From 62e38e29e539b1eb33b2c3cc79415d0beded57d8 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 15 Sep 2013 15:18:46 -0500 Subject: [PATCH] Add a new function named SupportedDBs. This function allows the callers to programatically ascertain which database backend drivers are registered and therefore supported. --- db.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db.go b/db.go index 808417ef..4c830df0 100644 --- a/db.go +++ b/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 +}