pgdesign v0.26.0 /internal/dbutil
On this page

Package dbutil rewrites PostgreSQL connection URLs to retarget the database, used when creating, dropping, or connecting to the maintenance database.

#internal/dbutil

#internal/dbutil

#SwapDatabase

Go go
func SwapDatabase(dbURL, newDB string) (string, error)

SwapDatabase rewrites a PostgreSQL connection URL to target a different database. Example: SwapDatabase("postgres://localhost:5432/myapp", "otherdb") returns "postgres://localhost:5432/otherdb"

#MaintenanceURL

Go go
func MaintenanceURL(dbURL string) (string, error)

MaintenanceURL rewrites a PostgreSQL connection URL to target the 'postgres' maintenance database.

Search