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

Add MySQL port, fixes #4 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var prefix = flag.String("prefix", "drp_", "Drupal table prefix")
var user = flag.String("user", "", "Drupal user (defaults to be the same as the Drupal database name)")
var pass = flag.String("pass", "", "Drupal password (you will be prompted for the password if this is absent)")
var host = flag.String("host", "localhost", "Mysql host")
var port = flag.String("port", "3306", "Mysql port")
var emvideoField = flag.String("emvideoField", "", "name of CCK field that holds emvideo data.")

//var dir = flag.String("dir", "", "Run in directory")
Expand Down Expand Up @@ -83,7 +84,7 @@ func main() {
}

// username:password@protocol(address)/dbname?param=value
db := model.Connect(*driver, *user+":"+*pass+"@tcp("+*host+")/"+*dbName, *prefix, *verbose)
db := model.Connect(*driver, *user+":"+*pass+"@tcp("+*host+":"+*port+")/"+*dbName, *prefix, *verbose)
cckFieldTypes, err := db.CCKFields()
if err != nil && *emvideoField != "" {
util.Fatal("Unable to retrieve CCK Field metadata: %s", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion model/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func chooseDialect(driver string) gorp.Dialect {
func controlTrace(trace bool, DbMap *gorp.DbMap) {
if trace {
dbTraceWriter := util.ConstructSomeLogWriter(traceLog, os.Stdout)
DbMap.TraceOn("", log.New(dbTraceWriter, "gorptest: ", log.Lmicroseconds))
DbMap.TraceOn("", "", log.New(dbTraceWriter, "gorptest: ", log.Lmicroseconds))
} else {
DbMap.TraceOff()
}
Expand Down