aboutsummaryrefslogtreecommitdiff
path: root/internal/database/database.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2019-11-21 19:41:40 -0500
committerJulie Qiu <julie@golang.org>2020-03-27 16:46:48 -0400
commitbb2fa47a767d0ec317bad674353e89a79c6189d0 (patch)
tree8d47339442d06a9f172fd38b741418a9a9000669 /internal/database/database.go
parent723f3612d1f5a8957fc5210e20f47dbd372e1bb6 (diff)
downloadgo-x-pkgsite-bb2fa47a767d0ec317bad674353e89a79c6189d0.tar.xz
internal/etl: use database.DB instead of sql.DB
Replace the direct use of sql.DB with the new database.DB. This will give us logging of autocomplete queries. Change-Id: I656e07b42359915a69dfc567c4c6f56d41900aab Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/604404 Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'internal/database/database.go')
-rw-r--r--internal/database/database.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/database/database.go b/internal/database/database.go
index b8b33f95..0c1a2269 100644
--- a/internal/database/database.go
+++ b/internal/database/database.go
@@ -29,12 +29,7 @@ type DB struct {
db *sql.DB
}
-// TODO(jba): remove
-func (db *DB) Underlying() *sql.DB {
- return db.db
-}
-
-// Open creates a new DB for the given connection string.
+// Open creates a new DB for the given connection string.
func Open(driverName, dbinfo string) (_ *DB, err error) {
defer derrors.Wrap(&err, "database.Open(%q, %q)",
driverName, redactPassword(dbinfo))