Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: golden/go/correctness_migratedb/main.go

Issue 813443002: Overhaul database package (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Comments/readme cleanup Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: golden/go/correctness_migratedb/main.go
diff --git a/golden/go/correctness_migratedb/main.go b/golden/go/correctness_migratedb/main.go
index 45ab64e4d240b48028d27ecd67170e06625efa7d..37e4e963f1d6cf7634be4f970820193d38699882 100644
--- a/golden/go/correctness_migratedb/main.go
+++ b/golden/go/correctness_migratedb/main.go
@@ -5,11 +5,7 @@ package main
// it is not entered via the command line.
import (
- "bufio"
"flag"
- "fmt"
- "os"
- "strings"
"github.com/golang/glog"
"skia.googlesource.com/buildbot.git/go/common"
@@ -28,23 +24,9 @@ func main() {
// Global init to initialize glog and parse arguments.
common.Init()
- var connectionStr = *dbConnString
-
- // if it contains formatting information read the password from stdin.
- if strings.Contains(connectionStr, "%s") {
- glog.Infof("Using connection string: %s", connectionStr)
- reader := bufio.NewReader(os.Stdin)
- fmt.Print("Enter password for MySQL: ")
- password, err := reader.ReadString('\n')
- if err != nil {
- glog.Fatalf("Unable to read password. Error: %s", err)
- }
- connectionStr = fmt.Sprintf(connectionStr, strings.TrimRight(password, "\n"))
- }
-
- conf := &database.DatabaseConfig{
- MySQLString: connectionStr,
- MigrationSteps: db.MigrationSteps(),
+ conf, err := database.ResolveCustomMySQLString(*dbConnString, db.MigrationSteps())
+ if err != nil {
+ glog.Fatal(err)
}
vdb := database.NewVersionedDB(conf)
« go/buildbot/db.go ('K') | « go/database/testutil/testutil.go ('k') | golden/go/db/db.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698