View definition

func ParseURL

Defined in


ParseURL no longer needs to be used by clients of this library since supplying a URL as a connection string to sql.Open() is now supported:

sql.Open("postgres", "postgres://bob:[email protected]:5432/mydb?sslmode=verify-full")

It remains exported here for backwards-compatibility.

ParseURL converts a url to a connection string for driver.Open. Example:

"postgres://bob:[email protected]:5432/mydb?sslmode=verify-full"

converts to:

"user=bob password=secret host= port=5432 dbname=mydb sslmode=verify-full"

A minimal example:


This will be blank, causing driver.Open to use all of the defaults

ParseURL is referenced in 52 repositories