db icon indicating copy to clipboard operation
db copied to clipboard

Connect to databa schema

Open marcelloh opened this issue 5 years ago • 2 comments

Will it be possible to configure a schema in the ConnectionURL?

marcelloh avatar Apr 24 '20 06:04 marcelloh

This should be possible as of today.

connURL, err := postgresql.ParseURL(fmt.Sprintf("postgres://%s:%s@%s/%s?application_name=%s&search_path=%s",
	username,
	password,
	host,
	dbName,
	appName,
	schemaName
))
if err != nil {
	return nil, err
}

VojtechVitek avatar Mar 30 '22 08:03 VojtechVitek

if you're using postgresql.ConnectionURL directly, try setting the schema in the Options map: {"search_path": "yourSchema"}.

VojtechVitek avatar Mar 30 '22 08:03 VojtechVitek