-
-
Notifications
You must be signed in to change notification settings - Fork 200
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: allow dbconfig options #968
Conversation
Pull Request Test Coverage Report for Build 746b513e9-PR-968Details
💛 - Coveralls |
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.
Looks really good! Only a few minor comments / requests and then we can land this. Thanks for tacking this one.
host := ttools.GetEnvDefault("PGHOST", "localhost") | ||
port, err := strconv.Atoi(ttools.GetEnvDefault("PGPORT", "5432")) | ||
// if port is anything but int, fallback to default | ||
if err != nil { | ||
port = 5432 | ||
} | ||
database := ttools.GetEnvDefault("PGDATABASE", "tegola") | ||
user := ttools.GetEnvDefault("PGUSER", "postgres") | ||
password := ttools.GetEnvDefault("PGPASSWORD", "postgres") | ||
|
||
cs := fmt.Sprintf("postgres://%v:%v@%v:%v/%v", user, password, host, port, database) |
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.
Note to self, I need to update our CI's env vars to have connection strings so you don't need to do this juggle.
98bc702
to
a2a3049
Compare
Done. My pleasure 🙏 |
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.
LGTM
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.
LGTM! Thanks for the additional updates.
application_name and default_transaction_read_only to be configurable Closes: go-spatial#966 fix: compare default_transaction_read_only with uppercase chore: use const for runtime param keys, update readme
a2a3049
to
ef1023c
Compare
application_name
anddefault_transaction_read_only
to be configurableCloses: #966