GetRowResults runs the query against a Postgres server and returns the resulting rows.
(query string)
| 114 | |
| 115 | // GetRowResults runs the query against a Postgres server and returns the resulting rows. |
| 116 | func GetRowResults(query string) ([]sql.Row, error) { |
| 117 | var err error |
| 118 | ctx := context.Background() |
| 119 | if postgresVerificationConnection == nil { |
| 120 | connectionString := fmt.Sprintf("postgres://postgres:password@127.0.0.1:%d/", 5432) |
| 121 | postgresVerificationConnection, err = pgx.Connect(ctx, connectionString) |
| 122 | if err != nil { |
| 123 | return nil, err |
| 124 | } |
| 125 | } |
| 126 | pgxRows, err := postgresVerificationConnection.Query(ctx, query) |
| 127 | if err != nil { |
| 128 | return nil, err |
| 129 | } |
| 130 | readRows, _, err := framework.ReadRows(pgxRows, true) |
| 131 | return readRows, err |
| 132 | } |
no test coverage detected