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(schema): add database schema config #1129

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

serrovsky
Copy link
Contributor

With this configuration, you can select database schema. This setting could be good when you want to share the same Postgres instance for different clusters validations.

@codecov
Copy link

codecov bot commented Mar 27, 2022

Codecov Report

Merging #1129 (f76b70a) into main (70a544e) will decrease coverage by 0.60%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1129      +/-   ##
==========================================
- Coverage   63.86%   63.26%   -0.61%     
==========================================
  Files          12       12              
  Lines        1882     1900      +18     
==========================================
  Hits         1202     1202              
- Misses        619      637      +18     
  Partials       61       61              
Impacted Files Coverage Δ
cmd/database.go 0.00% <0.00%> (ø)

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 70a544e...f76b70a. Read the comment docs.

cmd/database.go Outdated Show resolved Hide resolved
@mozillazg
Copy link
Collaborator

@luis-serra-ki Thanks for your contribution!

cmd/database.go Outdated Show resolved Hide resolved
cmd/database.go Show resolved Hide resolved
Comment on lines +61 to +66
if value := viper.GetString("PGSQL_SCHEMA"); value != "" {
schema = value
} else {
schema = ""
glog.V(2).Info("No schema set.")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if value := viper.GetString("PGSQL_SCHEMA"); value != "" {
schema = value
} else {
schema = ""
glog.V(2).Info("No schema set.")
}
schema = viper.GetString("PGSQL_SCHEMA")

db, err := gorm.Open(postgres.Open(PsqlConnInfo.toString()), &gorm.Config{})
var db *gorm.DB

if PsqlConnInfo.Schema == "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if PsqlConnInfo.Schema == "" {
if PsqlConnInfo.Schema == "" {
glog.V(2).Info("No schema set.")

@chen-keinan
Copy link
Collaborator

@luis-serra-ki thank you for the contribution , added a couple of comments

@mozillazg
Copy link
Collaborator

@serrovsky-pt Could you please take a look at these new comments? Thanks!

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.

None yet

3 participants