diff options
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/database.go | 12 | ||||
-rw-r--r-- | modules/setting/database_sqlite.go | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go index 02b5e43f4a..8db1cd13eb 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -16,9 +16,10 @@ import ( ) var ( - // SupportedDatabases includes all supported databases type - SupportedDatabases = []string{"MySQL", "PostgreSQL", "MSSQL"} - dbTypes = map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3"} + // SupportedDatabaseTypes includes all XORM supported databases type, sqlite3 maybe added by `database_sqlite3.go` + SupportedDatabaseTypes = []string{"mysql", "postgres", "mssql"} + // DatabaseTypeNames contains the friendly names for all database types + DatabaseTypeNames = map[string]string{"mysql": "MySQL", "postgres": "PostgreSQL", "mssql": "MSSQL", "sqlite3": "SQLite3"} // EnableSQLite3 use SQLite3, set by build flag EnableSQLite3 bool @@ -52,11 +53,6 @@ var ( } ) -// GetDBTypeByName returns the database type as it defined on XORM according the given name -func GetDBTypeByName(name string) string { - return dbTypes[name] -} - // InitDBConfig loads the database settings func InitDBConfig() { sec := Cfg.Section("database") diff --git a/modules/setting/database_sqlite.go b/modules/setting/database_sqlite.go index 798292fec8..12c60cc86c 100644 --- a/modules/setting/database_sqlite.go +++ b/modules/setting/database_sqlite.go @@ -13,5 +13,5 @@ import ( func init() { EnableSQLite3 = true - SupportedDatabases = append(SupportedDatabases, "SQLite3") + SupportedDatabaseTypes = append(SupportedDatabaseTypes, "sqlite3") } |