// OpenURL opens a database connection for the provided URL, reading the named
// passfile in the current user's home directory.
OpenURL opens a database connection for the provided URL, reading the named
passfile in the current user's home directory.
// OpenURL opens a database connection for the provided URL reading the named // passfile in the current user ' s home directory .
func OpenURL(v *dburl.URL, name string) (*sql.DB, error) {
	if v.User != nil {
		return sql.Open(v.Driver, v.DSN)
	}
	u, err := user.Current()
	if err != nil {
		return nil, err
	}
	user, err := Match(u, v, name)
	if err != nil {
		return sql.Open(v.Driver, v.DSN)
	}
	v.User = user
	z, _ := dburl.Parse(v.String())
	*v = *z
	return sql.Open(z.Driver, z.DSN)
}
func OpenURL ( v * dburl . URL , name string ) ( * sql . DB , error ) { if v . User != nil { return sql . Open ( v . Driver , v . DSN ) } u , err := user . Current ( ) if err != nil { return nil , err } user , err := Match ( u , v , name ) if err != nil { return sql . Open ( v . Driver , v . DSN ) } v . User = user z , _ := dburl . Parse ( v . String ( ) ) * v = * z return sql . Open ( z . Driver , z . DSN ) }
OpenURL opens a database connection for the provided URL, reading the named
passfile in the current user's home directory.
OpenURL opens a database connection for the provided URL reading the named passfile in the current user ' s home directory .