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

feat: add db connection configuration #254

Closed
wants to merge 2 commits into from
Closed

Conversation

singhvikash11
Copy link
Member

 value to error
@coveralls
Copy link

coveralls commented Aug 11, 2022

Pull Request Test Coverage Report for Build 2838249550

  • 0 of 9 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 75.961%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/store/postgres/store.go 0 9 0.0%
Files with Coverage Reduction New Missed Lines %
internal/store/postgres/store.go 1 0%
Totals Coverage Status
Change from base Build 2831363521: -0.09%
Covered Lines: 5574
Relevant Lines: 7338

💛 - Coveralls

@@ -41,6 +41,15 @@ func NewStore(c *store.Config) (*Store, error) {
log.Panic(err)
}

db, err := gormDB.DB()
if err != nil {
log.Panic(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Panic(err)
return nil, err

internal/store/config.go Show resolved Hide resolved
internal/store/postgres/store.go Show resolved Hide resolved
@bsushmith bsushmith changed the title Conn config feat: add db connection configuration Aug 11, 2022
@ravisuhag ravisuhag linked an issue Aug 15, 2022 that may be closed by this pull request
@bsushmith
Copy link
Member

@singhvikash11 these changes are present in the latest version of salt. Can we bump up the salt version and use that?

SslMode string `mapstructure:"sslmode" default:"disable"`
MaxIdleConns int `yaml:"max_idle_conns" mapstructure:"max_idle_conns" default:"3"`
MaxOpenConns int `yaml:"max_open_conns" mapstructure:"max_open_conns" default:"10"`
ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"10ms"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the clarity better to add the unit itself.

Suggested change
ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"10ms"`
ConnMaxLifeTimeMS time.Duration `yaml:"conn_max_life_time_ms" mapstructure:"conn_max_life_time" default:"10ms"`

@@ -1,12 +1,18 @@
package store

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are moving from gorm and I think we suppose to use salt/db

@ravisuhag
Copy link
Member

@singhvikash11 +1, we plan to remove Gorm. So salt/db package will be used for this. If any of the missing setting is not there then lets raise PR for that in salt.

@ravisuhag ravisuhag closed this Sep 21, 2022
@ravisuhag ravisuhag deleted the conn_config branch September 21, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to configure db connection settings
6 participants