MCPcopy Index your code
hub / github.com/coder/coder / dbNameFromConnectionURL

Function dbNameFromConnectionURL

coderd/database/dbtestutil/db.go:167–171  ·  view source on GitHub ↗

dbNameFromConnectionURL returns the database name from the given connection URL, where connectionURL is of the form postgres://user:pass@host:port/dbname

(t testing.TB, connectionURL string)

Source from the content-addressed store, hash-verified

165// dbNameFromConnectionURL returns the database name from the given connection URL,
166// where connectionURL is of the form postgres://user:pass@host:port/dbname
167func dbNameFromConnectionURL(t testing.TB, connectionURL string) string {
168 u, err := url.Parse(connectionURL)
169 require.NoError(t, err)
170 return strings.TrimPrefix(u.Path, "/")
171}
172
173// DumpOnFailure exports the database referenced by connectionURL to a file
174// corresponding to the current test, with a suffix indicating the time the

Callers 1

NewDBFunction · 0.85

Calls 1

ParseMethod · 0.65

Tested by

no test coverage detected