Skip to content
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

Move database settings from models to setting #7806

Open
wants to merge 8 commits into
base: master
from

Conversation

@lunny
Copy link
Member

commented Aug 9, 2019

And also added MAX_IDLE_CONNS and CONN_MAX_LIFETIME options.

@lunny lunny added this to the 1.10.0 milestone Aug 9, 2019

@lunny lunny force-pushed the lunny:lunny/db_config branch from d1976d9 to c5329b1 Aug 9, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Aug 9, 2019

Codecov Report

Merging #7806 into master will increase coverage by 0.01%.
The diff coverage is 40.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7806      +/-   ##
==========================================
+ Coverage   41.39%   41.41%   +0.01%     
==========================================
  Files         478      476       -2     
  Lines       63877    63812      -65     
==========================================
- Hits        26441    26426      -15     
+ Misses      33987    33944      -43     
+ Partials     3449     3442       -7
Impacted Files Coverage Δ
models/migrations/v27.go 0% <ø> (ø) ⬆️
models/migrations/v81.go 0% <ø> (ø) ⬆️
routers/install.go 0% <0%> (ø) ⬆️
models/migrations/v50.go 0% <0%> (ø) ⬆️
models/convert.go 0% <0%> (ø) ⬆️
routers/admin/admin.go 16.66% <0%> (ø) ⬆️
models/migrations/v22.go 0% <0%> (ø) ⬆️
models/migrations/v19.go 0% <0%> (ø) ⬆️
models/migrations/v45.go 0% <0%> (ø) ⬆️
cmd/cmd.go 30% <0%> (ø) ⬆️
... and 47 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85202d4...1d70d10. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 label Aug 9, 2019

func TestDumpDatabase(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())

dir, err := ioutil.TempDir(os.TempDir(), "dump")
assert.NoError(t, err)

for _, dbType := range supportedDatabases {
for _, dbType := range setting.SupportedDatabases {

This comment has been minimized.

Copy link
@sapk

sapk Aug 9, 2019

Member

Small nit but ease the understanding of code

Suggested change
for _, dbType := range setting.SupportedDatabases {
for _, dbName := range setting.SupportedDatabases {
dbType := setting.GetDBTypeByName(dbName)
EnableSQLite3 bool

// EnableTiDB enable TiDB, set by build flag
EnableTiDB bool

This comment has been minimized.

Copy link
@techknowlogick

techknowlogick Aug 10, 2019

Member

no longer supported

return "", fmt.Errorf("Failed to create directories: %v", err)
}
connStr = fmt.Sprintf("file:%s?cache=shared&mode=rwc&_busy_timeout=%d", Database.Path, Database.Timeout)
case "tidb":

This comment has been minimized.

Copy link
@techknowlogick

techknowlogick Aug 10, 2019

Member

no longer supported

log.Info("SQLite3 Supported")
}
if models.EnableTiDB {
if setting.EnableTiDB {

This comment has been minimized.

Copy link
@techknowlogick

techknowlogick Aug 10, 2019

Member

no longer supported

@lunny

This comment has been minimized.

Copy link
Member Author

commented Aug 10, 2019

lunny added some commits Aug 9, 2019

@lunny lunny force-pushed the lunny:lunny/db_config branch from a332bd3 to 1d70d10 Aug 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.