-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@luis-serra-ki Thanks for your contribution! |
Co-authored-by: Huang Huang <mozillazg101@gmail.com>
if value := viper.GetString("PGSQL_SCHEMA"); value != "" { | ||
schema = value | ||
} else { | ||
schema = "" | ||
glog.V(2).Info("No schema set.") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if PsqlConnInfo.Schema == "" { | |
if PsqlConnInfo.Schema == "" { | |
glog.V(2).Info("No schema set.") |
@luis-serra-ki thank you for the contribution , added a couple of comments |
@serrovsky-pt Could you please take a look at these new comments? Thanks! |
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.