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

make postgres connection string optional #948

Merged
merged 4 commits into from Nov 23, 2020

Conversation

johnnyaug
Copy link
Contributor

No description provided.

Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

How was this tested? (Can we add it to Nessie? Do we want to??)

db/migration.go Outdated
m, err := migrate.NewWithSourceInstance("httpfs", src, params.ConnectionString)
var m *migrate.Migrate
if params.ConnectionString == "" {
m, err = getMigrateUsingEnvVariables(src)
Copy link
Contributor

Choose a reason for hiding this comment

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

(Trying to learn migrate...) This ends up calling NewWithInstance, the other branch calls NewWithSourceInstance. Can't we do the same in both and have a smaller getMigrateUsingEnvVariables?

@arielshaqed
Copy link
Contributor

How was this tested? (Can we add it to Nessie? Do we want to??)

[Not in this PR, of course...]

@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #948 (8c39b33) into master (0f3084a) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #948      +/-   ##
==========================================
- Coverage   44.44%   44.43%   -0.02%     
==========================================
  Files         143      143              
  Lines       11486    11487       +1     
==========================================
- Hits         5105     5104       -1     
- Misses       5744     5746       +2     
  Partials      637      637              
Impacted Files Coverage Δ
config/config.go 33.33% <ø> (-0.46%) ⬇️
db/migration.go 0.00% <0.00%> (ø)
catalog/cataloger_commit.go 79.71% <0.00%> (-2.90%) ⬇️
catalog/cataloger_create_repository.go 62.96% <0.00%> (+3.70%) ⬆️

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 0f3084a...8c39b33. Read the comment docs.

db/migration.go Outdated
@@ -107,7 +105,9 @@ func getMigrate(params params.Database) (*migrate.Migrate, error) {
defer func() {
_ = src.Close()
}()

if params.ConnectionString == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you do this one on a temp var so we will not modify the caller data

Copy link
Contributor

@nopcoder nopcoder left a comment

Choose a reason for hiding this comment

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

cool!

@johnnyaug johnnyaug merged commit b69c89a into master Nov 23, 2020
@johnnyaug johnnyaug deleted the feature/psql_conn_string_optional branch November 23, 2020 08:53
@johnnyaug johnnyaug restored the feature/psql_conn_string_optional branch November 23, 2020 08:54
@johnnyaug johnnyaug deleted the feature/psql_conn_string_optional branch November 23, 2020 08:54
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

4 participants