MCPcopy
hub / github.com/autobrr/qui / dsnWithSearchPath

Function dsnWithSearchPath

internal/database/postgres_integration_test.go:200–211  ·  view source on GitHub ↗
(t *testing.T, dsn string, schema string)

Source from the content-addressed store, hash-verified

198}
199
200func dsnWithSearchPath(t *testing.T, dsn string, schema string) string {
201 t.Helper()
202
203 parsed, err := url.Parse(dsn)
204 if err != nil {
205 t.Fatalf("parse postgres dsn: %v", err)
206 }
207 query := parsed.Query()
208 query.Set("search_path", schema)
209 parsed.RawQuery = query.Encode()
210 return parsed.String()
211}

Callers 1

openPostgresTestSchemaFunction · 0.85

Calls 3

ParseMethod · 0.45
SetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected