mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Refactor install page (db type) (#17919)
* Refactor install page (db type) * set correct default DB HOST for different DB TYPE * remove legacy TiDB from documents * unify the usage of DB TYPE, in code we only use "mysql". "MySQL" is only shown to users for friendly name. * Gitea can use TiDB via MySQL protocol Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -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")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user