Skip to content

The migrate package should support multiple database drivers, not only MySQL #5644

@johnknapp

Description

@johnknapp

Experience Report

  • Running dgraph migrate on a postgres database fails.

What you wanted to do

  • I wanted a successful migration of a postgres database.
  • I wanted to specify db driver in my config.properties
  • I wanted the migrate package to load and use the correct driver

What you actually did

  • I ran dgraph migrate --config config.properties --output_schema schema.txt --output_data sql.rdf
  • I ran this on a postgres database

Why that wasn't great, with examples

  • I received error message: driver: bad connection

Any external references to support your case

From dgraph/cmd/migrate/utils.go:32

func getPool(host, port, user, password, db string) (*sql.DB,
	error) {
	return sql.Open("mysql",
		fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?parseTime=true", user, password, host, port, db))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/operationsRelated to operational aspects of the DB, including signals, flags, env vars, etc.area/toolsIssues related to maintenance tools and CLI.kind/enhancementSomething could be better.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions