(driver, connection string)
| 259 | } |
| 260 | |
| 261 | func initDatabase(driver, connection string) (*xorm.Engine, error) { |
| 262 | dataConf := &data.Database{Driver: driver, Connection: connection} |
| 263 | if !CheckDBConnection(dataConf) { |
| 264 | return nil, fmt.Errorf("database connection check failed") |
| 265 | } |
| 266 | |
| 267 | engine, err := data.NewDB(false, dataConf) |
| 268 | if err != nil { |
| 269 | return nil, err |
| 270 | } |
| 271 | |
| 272 | return engine, nil |
| 273 | } |
| 274 | |
| 275 | func printWarning(msg string) { |
| 276 | if runtime.GOOS == "windows" { |
no test coverage detected