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

Bump github.com/upper/db/v4 from 4.2.1 to 4.5.4 #336

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 28, 2022

Bumps github.com/upper/db/v4 from 4.2.1 to 4.5.4.

Release notes

Sourced from github.com/upper/db/v4's releases.

Release v4.5.4

No release notes provided.

Release v4.5.3

No release notes provided.

Release v4.5.2

No release notes provided.

v4.5.0

Release notes

The github.com/lib/pq package that we used as driver for PostgreSQL and CockroachDB went under maintenance mode, the package maintainers recommended users to switch to github.com/jackc/pgx. We followed that recommendation, and this release uses github.com/jackc/pgx as driver for both PostgreSQL and CockroachDB.

For some codebases, the update will be completely transparent, but others cases might require slight modifications to their code, specially if they're using custom field types. If you're upgrading to v4.5.0 make sure you're either using the special types with driver.Value and sql.Scanner methods provided by the github.com/upper/db/v4/adapter/postgresql package, or provide your own ones.

If the change is too complicated, you'll be able to use github.com/lib/pq for a while by including the pgx build constraint along the other build tags. See:

go build -tags=pgx ...

however, this is a temporary solution, support for the github.com/lib/pq driver is going to be definitely removed on February 28th 2022.

Upgrading your codebase

If you upgraded to v4.5.0 and your code doesn't compile anymore or if it throws runtime errors around conversions between Go types and database types you'll have to tweak it a bit. Basically, you'll have to make sure you're providing scanners and values for all your types. Basic Go types, like int, string, bool or even a slice of basic types won't require any special handling, but some other types like *[]intor []uint will do.

For instance, if your struct looks like this:

type Foo struct {
	ID     uint64    `db:"id"`
	Names  *[]string `db:"names"`
}

you'll have to convert it into:

import (
	"github.com/upper/db/v4/adapter/postgresql"
)
type Foo struct {
ID      uint64                  db:"id" // no need to be updated
Names   *postgresql.StringArray db:"names" // changed
}

... (truncated)

Commits
  • 2147806 Merge pull request #652 from upper/with-context
  • b5aff2b Merge pull request #656 from upper/allow-select-from-db-result
  • 9709cdd allow using db.Result as subquery
  • d8a05e0 add ConnMaxIdleTime and SetConnMaxIdleTime
  • 3d239ab fix tests
  • 2bc9c5e refactor WithContext to make it work without cloning the session
  • bb6a386 Merge pull request #650 from upper/update-pgx
  • cefac3b upgrade pgx and pgtype deps
  • f79575d Merge pull request #649 from upper/refactor-memory-and-speed-optimizations
  • 471ba7e optimize prepareQueryForDisplay
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 28, 2022
Bumps [github.com/upper/db/v4](https://github.com/upper/db) from 4.2.1 to 4.5.4.
- [Release notes](https://github.com/upper/db/releases)
- [Commits](upper/db@v4.2.1...v4.5.4)

---
updated-dependencies:
- dependency-name: github.com/upper/db/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/upper/db/v4-4.5.4 branch from d2ee99e to c84e73d Compare August 12, 2022 17:05
@codecov-commenter
Copy link

Codecov Report

Merging #336 (c84e73d) into main (1f6f63a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #336   +/-   ##
=======================================
  Coverage   68.78%   68.78%           
=======================================
  Files          11       11           
  Lines        2034     2034           
=======================================
  Hits         1399     1399           
  Misses        534      534           
  Partials      101      101           

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 1f6f63a...c84e73d. Read the comment docs.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Sep 5, 2022

Superseded by #356.

@dependabot dependabot bot closed this Sep 5, 2022
@dependabot dependabot bot deleted the dependabot/go_modules/github.com/upper/db/v4-4.5.4 branch September 5, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant