-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add more gorm-driver #138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #138 +/- ##
==========================================
+ Coverage 80.20% 80.28% +0.07%
==========================================
Files 89 89
Lines 3840 3844 +4
==========================================
+ Hits 3080 3086 +6
+ Misses 561 559 -2
Partials 199 199
Continue to review full report at Codecov.
|
Not sure if we need them in this project. We are testing the config and tracing integration, not GORM itself. Those drivers belong to the tests in GORM project, not here. ie. As long as one of the drivers works, the integration of GORM works. |
Yes, it does increase the cost of testing. So i just need to keep the following code? func provideDialector(conf *databaseConf) (gorm.Dialector, error) {
drivers := map[string]func(dsn string) gorm.Dialector{
"mysql": mysql.Open,
"sqlite": sqlite.Open,
"postgres": postgres.Open,
"sqlserver": sqlserver.Open,
"clickhouse": clickhouse.Open,
}
if driver, ok := drivers[conf.Database]; ok {
return driver(conf.Dsn), nil
}
return nil, fmt.Errorf("unknow database type %s", conf.Database)
} |
No description provided.