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