MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / configurePgHBAWithMD5

Function configurePgHBAWithMD5

cmd/sqlc-test-setup/main.go:519–527  ·  view source on GitHub ↗

configurePgHBAWithMD5 rewrites pg_hba.conf to use md5 for TCP connections.

(hbaPath string)

Source from the content-addressed store, hash-verified

517
518// configurePgHBAWithMD5 rewrites pg_hba.conf to use md5 for TCP connections.
519func configurePgHBAWithMD5(hbaPath string) error {
520 content := `# pg_hba.conf - generated by sqlc-test-setup
521# TYPE DATABASE USER ADDRESS METHOD
522local all all trust
523host all all 127.0.0.1/32 md5
524host all all ::1/128 md5
525`
526 return os.WriteFile(hbaPath, []byte(content), 0o600)
527}
528
529// appendToFile appends text to a file.
530func appendToFile(path, text string) error {

Callers 1

startPostgreSQLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected