georgysavva / scany

Library for scanning data from a database into Go structs and more
MIT License
1.23k stars 67 forks source link

support pgx v5 #94

Closed vadimi closed 1 year ago

vadimi commented 1 year ago

since pgx v5 contains breaking changes (supports go 1.18+ only) this package also needs to have a version bump - v2

should fix #88

codecov[bot] commented 1 year ago

Codecov Report

Merging #94 (bcc6d24) into master (5c09502) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #94   +/-   ##
=======================================
  Coverage   82.81%   82.81%           
=======================================
  Files           5        5           
  Lines         512      512           
=======================================
  Hits          424      424           
  Misses         73       73           
  Partials       15       15           
Flag Coverage Δ
unittests 82.81% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sqlscan/sqlscan.go 64.70% <ø> (ø)
pgxscan/pgxscan.go 70.73% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

georgysavva commented 1 year ago

@vadimi Thank you for your work. It looks great!

I think we also need to update the readme file to use the new module name

vadimi commented 1 year ago

@georgysavva thanks, that makes sense, updated the readme. I also noticed golangci lint is failing, so I updated it to latest to see if it helps.

lzap commented 1 year ago

Thanks for this, eagerly awaiting this to be released :-)

darkliquid commented 1 year ago

Looking forward to seeing this released - been on a big OpenTelemetry push recently, so will be nice to be able to use the new support in pgx5 for that.

In the mean time, I've been using a replace directive in my go.mod to allow me to use this PR.

replace github.com/georgysavva/scany/v2 => github.com/vadimi/scany/v2 v2.0.0-20220923222004-64484fa02b2c
lzap commented 1 year ago

Hands up who's reason is OpenTelemetry too! :-) Thanks, nice trick actually. Had no idea it works remotely too.

georgysavva commented 1 year ago

@vadimi Thanks for updating the readme!

Yes, I also noticed that golangci-lint is broken. I fixed it in the master, along with other GitHub action bumps. So I just merged the changes into your branch. I also fixed a few leftovers for the old version paths.

Now the PR is ready. Thank you so much for taking on it! I am going to proceed with merging it and releasing the v2 tag.

georgysavva commented 1 year ago

Here everyone. I created a pre-release for scany/v2: https://github.com/georgysavva/scany/releases/tag/v2.0.0-alpha.2. You can install it the following way: go get https://github.com/georgysavva/scany/v2@v2.0.0-alpha.2.

Please test it out a little bit, and if everything is fine, I will make the stable release.

kohenkatz commented 1 year ago

Thank you for this PR, but you missed something - import "github.com/jackc/pgtype" should have been changed to "github.com/jackc/pgx/v5/pgtype", as noted in CHANGELOG.md.