Skip to content

Conversation

@sudo-suhas
Copy link
Contributor

  • Add column to assets table for URL.
  • Store the asset's URL field in DB as part of insert/upsert.
  • Retrieve the asset's URL field from DB for fetch APIs.
  • Refactor UPDATE statement to use squirrel for easier maintenance.

- Add column to assets table for URL.
- Store the asset's URL field in DB as part of insert/upsert.
- Retrieve the asset's URL field from DB for fetch APIs.
- Refactor UPDATE statement to use squirrel for easier maintenance.
@sudo-suhas sudo-suhas requested a review from haveiss February 21, 2023 12:08
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4232473912

  • 24 of 26 (92.31%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 86.107%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/store/postgres/asset_repository.go 17 19 89.47%
Files with Coverage Reduction New Missed Lines %
internal/store/postgres/asset_repository.go 1 77.37%
Totals Coverage Status
Change from base Build 4232425834: -0.02%
Covered Lines: 5008
Relevant Lines: 5816

💛 - Coveralls

a.service as service,
a.description as description,
a.data as data,
COALESCE(a.url, '') as url,
Copy link

@haveiss haveiss Feb 22, 2023

Choose a reason for hiding this comment

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

how this compared to set url default to '' when altering table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Altering a table with default value used to take a lock for updating all rows (which would block reads and writes). This looks to have been fixed in PG 11 but I wasn't aware of that while making these changes.

@ravisuhag ravisuhag merged commit 495c666 into main Feb 22, 2023
@ravisuhag ravisuhag deleted the fix-asset-url-fetch branch February 22, 2023 04:24
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4232473912

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 24 of 26 (92.31%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.5%) to 85.598%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/store/postgres/asset_repository.go 17 19 89.47%
Files with Coverage Reduction New Missed Lines %
internal/store/postgres/asset_repository.go 1 77.37%
Totals Coverage Status
Change from base Build 4232425834: -0.5%
Covered Lines: 4642
Relevant Lines: 5423

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4232473912

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 24 of 26 (92.31%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.5%) to 85.598%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/store/postgres/asset_repository.go 17 19 89.47%
Files with Coverage Reduction New Missed Lines %
internal/store/postgres/asset_repository.go 1 77.37%
Totals Coverage Status
Change from base Build 4232425834: -0.5%
Covered Lines: 4642
Relevant Lines: 5423

💛 - Coveralls

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.

5 participants