Move database connection utils to dbconn
Created by: asdine
There currently are two separate connection helpers, using two different PG drivers.
This unifies database connection helpers and merges them into one single package.
dbconn
is now the only package responsible for connecting to the database and database migrations.
dbutil
is now only responsible for generic helpers.
Note: This relies on adding support for driver.ConnBeginTx on the sqlhooks package https://github.com/gchaincl/sqlhooks/pull/33
Fixes #16586
Merge request reports
Activity
Created by: sourcegraph-bot
Notifying subscribers in CODENOTIFY files for diff f96e136470b17a15dd1ad8b040515a1b3a2718b4...46ae5816a32d7c487442fe0ca164c5c966636e50.
Notify File(s) @efritz internal/db/basestore/handle.go
internal/db/dbconn/dbconn.go
internal/db/dbconn/migration.go
internal/db/dbtest/dbtest.go
internal/db/dbtesting/dbtesting.go
internal/db/dbutil/dbutil.go@keegancsmith cmd/gitserver/main.go Created by: codecov[bot]
Codecov Report
Merging #17399 (46ae581) into main (f96e136) will increase coverage by
0.01%
. The diff coverage is14.54%
.@@ Coverage Diff @@ ## main #17399 +/- ## ========================================== + Coverage 51.87% 51.89% +0.01% ========================================== Files 1716 1717 +1 Lines 85296 85275 -21 Branches 7647 7634 -13 ========================================== + Hits 44246 44251 +5 + Misses 37148 37124 -24 + Partials 3902 3900 -2
Flag Coverage Δ go 50.87% <14.54%> (+0.02%)
integration 30.69% <ø> (+<0.01%)
storybook 30.34% <ø> (ø)
typescript 54.35% <ø> (+<0.01%)
unit 34.72% <ø> (ø)
Impacted Files Coverage Δ cmd/gitserver/main.go 10.12% <0.00%> (ø)
internal/db/basestore/handle.go 61.53% <0.00%> (ø)
internal/db/dbconn/dbconn.go 11.38% <0.00%> (ø)
internal/db/dbutil/dbutil.go 19.14% <ø> (+2.32%)
internal/db/dbconn/migration.go 17.39% <17.39%> (ø)
client/web/src/nav/StatusMessagesNavItem.tsx 87.71% <0.00%> (+1.75%)
.../internal/codeintel/resolvers/graphql/locations.go 85.56% <0.00%> (+4.12%)