integresql-client-go icon indicating copy to clipboard operation
integresql-client-go copied to clipboard

DatabaseConfig.ConnectionString() doesn't handle empty values or spaces

Open wttw opened this issue 3 years ago • 0 comments

In a postgresql connection string an empty value or a value with spaces in it needs to be surrounded with single quotes - e.g. user=steve password='' dbname=whatever.

If, say, the password is blank then without those quotes user=steve password= dbname=whatever will use "dbname=whatever" as the password and end up connecting to the default database, rather than the expected temporary one.

wttw avatar Nov 13 '22 17:11 wttw