// GenSnowflake generates a snowflake DSN from the passed URL.
GenSnowflake generates a snowflake DSN from the passed URL.
// GenSnowflake generates a snowflake DSN from the passed URL .
func GenSnowflake(u *URL) (string, error) {
	host, port, dbname := u.Hostname(), u.Port(), strings.TrimPrefix(u.Path, "/")
	if host == "" {
		return "", ErrMissingHost
	}
	if port != "" {
		port = ":" + port
	}
	if u.User == nil {
		return "", ErrMissingUser
	}
	user := u.User.Username()
	if pass, _ := u.User.Password(); pass != "" {
		user += ":" + pass
	}
	return user + "@" + host + port + "/" + dbname + genQueryOptions(u.Query()), nil
}
func GenSnowflake ( u * URL ) ( string , error ) { host , port , dbname := u . Hostname ( ) , u . Port ( ) , strings . TrimPrefix ( u . Path , " " ) if host == " " { return " " , ErrMissingHost } if port != " " { port = " " + port } if u . User == nil { return " " , ErrMissingUser } user := u . User . Username ( ) if pass , _ := u . User . Password ( ) ; pass != " " { user += " " + pass } return user + " " + host + port + " " + dbname + genQueryOptions ( u . Query ( ) ) , nil }
GenSnowflake generates a snowflake DSN from the passed URL.
GenSnowflake generates a snowflake DSN from the passed URL .
// add user/pass