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

Function configurePgHBA

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

configurePgHBA writes a pg_hba.conf that allows trust auth initially (for setting the password), then we switch to md5.

(hbaPath string)

Source from the content-addressed store, hash-verified

506// configurePgHBA writes a pg_hba.conf that allows trust auth initially (for
507// setting the password), then we switch to md5.
508func configurePgHBA(hbaPath string) error {
509 content := `# pg_hba.conf - generated by sqlc-test-setup
510# TYPE DATABASE USER ADDRESS METHOD
511local all all trust
512host all all 127.0.0.1/32 trust
513host all all ::1/128 trust
514`
515 return os.WriteFile(hbaPath, []byte(content), 0o600)
516}
517
518// configurePgHBAWithMD5 rewrites pg_hba.conf to use md5 for TCP connections.
519func configurePgHBAWithMD5(hbaPath string) error {

Callers 1

startPostgreSQLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected