Documentation
¶
Index ¶
Constants ¶
View Source
const ErrCodeUniqueViolation = "23505"
Variables ¶
This section is empty.
Functions ¶
func BuildConnectionURI ¶
BuildConnectionURI builds a connection string for lib/pq from Config. If a missing or invalid field is provided, an error is returned.
func RandomDBName ¶
RandomDBName generates a Postgres database name with a provided prefix and random suffix in order to avoid collisions and race conditions in parallel tests.
This uses a pseudorandom integer rather than a UUID to avoid hyphens in the database name. Postgres database names with hyphens do not autocomplete on the psql command line, which is a pain in case you get stuck manually deleting a bunch of these.
Types ¶
Click to show internal directories.
Click to hide internal directories.