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

Function pgIsReady

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

pgIsReady checks if PostgreSQL is running and accepting connections.

()

Source from the content-addressed store, hash-verified

539
540// pgIsReady checks if PostgreSQL is running and accepting connections.
541func pgIsReady() bool {
542 cmd := exec.Command(pgBin("pg_isready"), "-h", "127.0.0.1", "-p", "5432")
543 return cmd.Run() == nil
544}
545
546// waitForPostgreSQL polls until PostgreSQL accepts connections or times out.
547func waitForPostgreSQL(timeout time.Duration) error {

Callers 2

startPostgreSQLFunction · 0.85
waitForPostgreSQLFunction · 0.85

Calls 1

pgBinFunction · 0.85

Tested by

no test coverage detected