MCPcopy Index your code
hub / github.com/dreamsofcode-io/zenstats / dbURL

Function dbURL

internal/database/database.go:51–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func dbURL() (string, error) {
52 cfg, err := config.NewDatabase()
53 if err != nil {
54 dbURL, ok := os.LookupEnv("DATABASE_URL")
55 if !ok {
56 return "", fmt.Errorf("Must set DATABASE_URL env var")
57 }
58
59 return dbURL, nil
60 }
61
62 return cfg.URL(), nil
63}
64
65func Connect(ctx context.Context, logger *slog.Logger, migrations fs.FS) (*pgxpool.Pool, error) {
66 config, err := loadConfig()

Callers 1

ConnectFunction · 0.85

Calls 2

URLMethod · 0.95
NewDatabaseFunction · 0.92

Tested by

no test coverage detected