MCPcopy
hub / github.com/sqlc-dev/sqlc / MySQLReformatURI

Function MySQLReformatURI

internal/quickdb/mysql.go:10–16  ·  view source on GitHub ↗

The database URI returned by the QuickDB service isn't understood by the go-mysql-driver

(original string)

Source from the content-addressed store, hash-verified

8// The database URI returned by the QuickDB service isn't understood by the
9// go-mysql-driver
10func MySQLReformatURI(original string) (string, error) {
11 u, err := url.Parse(original)
12 if err != nil {
13 return "", err
14 }
15 return fmt.Sprintf("%s@tcp(%s)%s?multiStatements=true&parseTime=true&tls=true", u.User, u.Host, u.Path), nil
16}

Callers 1

fetchDatabaseUriMethod · 0.92

Calls 1

ParseMethod · 0.65

Tested by

no test coverage detected